This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am samuraisam on github. | |
* I am ssutch (https://keybase.io/ssutch) on keybase. | |
* I have a public key whose fingerprint is CB73 AA67 8197 4715 8413 0169 52F3 85BF 58A0 3967 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constant CURDIR = IO::Spec.splitpath($?FILE)[1]; | |
constant FN = IO::Spec.catdir(CURDIR, 'Proto', 'ql2_13x.proto'); | |
module RethinkDB::Proto { | |
# classes are generated here | |
use PB::Model::Generator FN; | |
} | |
BEGIN { | |
for RethinkDB::Proto::.kv -> \sym, \obj { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $fn = IO::Spec.catdir($?FILE, 'Proto', 'ql2_13x.proto'); | |
use PB::Model::Generator $fn; | |
# => No such method 'IO' for invocant of type 'Any' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ObjectPermissions(object): | |
perms_map = {} | |
specific_object_perms = () | |
@classmethod | |
def require(cls, *new_perms): | |
class SpecificObjectPermissions(cls): | |
specific_object_perms = new_perms | |
return SpecificObjectPermissions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var elementMap = { | |
'char': 'dyn-text-field' | |
}; | |
var DynamicFormField = Ember.Component.extend({ | |
template: Ember.computed('entry.field', function(key, value) { | |
var kind = this.get('entry.field.kind'); | |
var helperName = elementMap[kind] || 'dyn-text-field'; | |
var tmpl = '{{' + helperName + ' entry=entry}}'; | |
return Ember.Handlebars.compile(tmpl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MyRoute = Ember.Route.extend({ | |
model: function() { | |
// this will resolve | |
return Ember.$.ajax().then(function(data) { | |
// then this will resolve | |
return Ember.RSVP.Promise.all([ | |
Ember.$.ajax({url: data.item1url}), | |
Ember.$.ajax({url: data.item2url}) | |
]).then(function(items) { | |
// and this will be your model in the controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extractEmbeddedData(obj, propertyName, store, persistedName) { | |
var ids = []; | |
var embeddedObjs = []; | |
if (!Ember.isNone(obj[propertyName])) { | |
var subObj = obj[propertyName]; | |
var isArray = Array.isArray(subObj); | |
if (!isArray) { | |
subObj = [subObj]; | |
} | |
subObj.forEach(function(subElement) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// generalize some of the embedded extraction. transforms merchant.locations into ids and returns a list of locations | |
function extractEmbeddedData(obj, propertyName) { | |
var ids = []; | |
var embeddedObjs = []; | |
if (!Ember.isNone(obj[propertyName])) { | |
var subObj = obj[propertyName]; | |
var isArray = Array.isArray(subObj); | |
if (!isArray) { | |
subObj = [subObj]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ManagedObject.h | |
// | |
// Created by Samuel Sutch on 10/21/13. | |
// Copyright (c) 2013 Steamboat Labs. All rights reserved. | |
// | |
#import <CoreData/CoreData.h> | |
#import <AFNetworking/AFNetworking.h> | |
#import <JSONKit.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.m | |
// mdb-bench | |
// | |
// Created by Samuel Sutch on 9/29/13. | |
// Copyright (c) 2013 Steamboat Labs. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <JSONKit/JSONKit.h> |