Skip to content

Instantly share code, notes, and snippets.

View skylar's full-sized avatar

Skylar Woodward skylar

View GitHub Profile
module.exports = function(defaults) {
var env = EmberApp.env(),
isProductionLikeBuild = ('production' === env) || ('staging' === env);
var app = new EmberApp(defaults, {
minifyCSS: { enabled: !!isProductionLikeBuild },
minifyJS: { enabled: !!isProductionLikeBuild },
fingerprint: {
enabled: !!isProductionLikeBuild,
generateRailsManifest: true,
exclude: ['manifest.json']
@skylar
skylar / api_output_marshal-mass_pay.rb
Last active August 29, 2015 14:20
account number - short circuit status
class ApiOutputMarshal::MassPay
attr_reader :mass_pay
def initalize(mass_pay)
@mass_pay = mass_pay
end
def status
last_two = mass_pay.bank_account.account_number[-2..-1].to_i
if (0..5).member?(last_two)
@skylar
skylar / dm_string_enum.rb
Created July 24, 2014 03:06
A string-backed Enum type for DataMapper
require 'dm-types/support/flags'
module DataMapper
class Property
class StringEnum < String
min 1
include Flags
def initialize(model, name, options = {})
require 'dm-core'
require 'money'
module DataMapper
class Property
class Money < Object
# load_as ::Money
# dump_as ::String
# coercion_method :to_money
@skylar
skylar / gist:3430735
Created August 23, 2012 00:01
Money type for DM
require 'dm-core'
require 'money'
module DataMapper
class Property
class Money < String
load_as ::Money
dump_as ::Money
coercion_method :to_money
end
@skylar
skylar / ember-data.js
Created February 28, 2012 23:44
a current build of ember-data
(function(exports) {
window.DS = Ember.Namespace.create({
CURRENT_API_REVISION: 2
});
})({});
(function(exports) {
@skylar
skylar / ember-data-test.js
Created February 28, 2012 23:30
where's the key?
var App = Em.Application.create();
App.Person = DS.Model.extend({
name: DS.attr('string')
, location: DS.attr('string')
});
var primaryKey = Ember.getPath('App.Merchant', 'proto.primaryKey');
// expected primaryKey to be 'id'
skylar@dev-vm:~/kiva/main/sites/testing$ puppetd --test
warning: peer certificate won't be verified in this SSL session
err: Could not request certificate: Certificate retrieval failed: Certificate request does not match existing certificate; run 'puppetca --clean dev-vm.localdomain'.
require("sproutcore");
Kivakity = SC.Application.create();
Klb.COUNTRIES_ISO = [
{"iso_code":"AF",
"iso_name":"AFGHANISTAN",
"name":"_AFGHANISTAN".loc(),
"region":"xx"},
{"iso_code":"AX",
"iso_name":"ÅLAND ISLANDS",
"name":"_ÅLAND_ISLANDS".loc(),
"region":"xx"}];