Skip to content

Instantly share code, notes, and snippets.

View dereklucas's full-sized avatar
🐢
We're gonna make it.

Derek Lucas dereklucas

🐢
We're gonna make it.
View GitHub Profile
@cmelchior
cmelchior / CustomTypeAdapter.java
Created April 9, 2015 06:35
Realm, GSON and primitive JSON arrays
// Make a custom Gson instance, with a custom TypeAdapter for each wrapper object.
// In this instance we only have RealmList<RealmInt> as a a wrapper for RealmList<Integer>
Type token = new TypeToken<RealmList<RealmInt>>(){}.getType();
Gson gson = new GsonBuilder()
.setExclusionStrategies(new ExclusionStrategy() {
@Override
public boolean shouldSkipField(FieldAttributes f) {
return f.getDeclaringClass().equals(RealmObject.class);
}
@ichi
ichi / Capfile
Last active August 29, 2015 14:17
capistranoでlogをtail (with Airbrussh)
# 略...
# formatter
require "airbrussh/capistrano"
require_relative 'lib/capistrano/airbrussh.rb'
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
@wojtha
wojtha / fake_stripe_server.rb
Last active September 28, 2016 22:06
Fake Stripe mock backend server for generating tokens for stripe.js
#!/usr/bin/env ruby
require 'sinatra/base'
require 'json'
require 'stripe_mock'
# Mount fake Sinatra Stripe Server to Capybara
#
# Example:
#
# feature 'Subscribe' do
@dbankier
dbankier / alloy.jmk
Created May 25, 2013 12:45
alloy.jmk for automatic spy injection for TiShadow
task("pre:compile", function(event,logger) {
var wrench = require("wrench"),
fs = require("fs"),
controllers_root = event.dir.controllers,
path = require("path");
if (event.alloyConfig.deployType === 'production') {
return;
}
@grantges
grantges / WildText.js
Last active December 14, 2015 11:18
CommonJS Module for Titanium that allows you to create gradient filled Labels (note: iOS only) Updated to include updates from Todd Lindner - as noted here : https://gist.github.com/toddlindner/5093536
/*
WildText CommonJS module for Appcelerator Titanium
Create dynamic gradient filled text in your iOS Applications using this simple module.
@params : text - String. The text for your label
font - Font. Specify the font attributes for the label (defaults to standard size, weight and family),
backgroundGradient - BackgroundGradient. Specify your backgroundGradient object (defaults to White to Black linear gradient),
Top - Integer. Top property for your label,
Left - Integer. Left Property for your Label,