I hereby claim:
- I am interlock on github.
- I am pixelgirl (https://keybase.io/pixelgirl) on keybase.
- I have a public key ASA3v9Z_Fn6n1gawsmql1d7MJyDh1cLya6IP1rdZByrrKgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var Example = function() { | |
}; | |
Object.defineProperty(Example.prototype,'message',{ | |
enumerable: true, | |
set: function(v) { | |
this._message = v; | |
}, | |
get: function() { |
My hack to output a CSV of Specs and estimates associated to them. I used this for a project that we wrote stub specs for instead of a requirements document for. Ultimately, needed to get a general idea of the amount of work, so created this Jasmine plugin.
This is for jasmine specs that run within node.js. It will not work in a browser.
Within any "it" spec, call units(x) to associate an estimated number of work units for that spec. The units are whatever you use to do project planning, in my case, 0,1,2,4,8.
/* Also called from the AppDelegate */ | |
- (void)configureRestKit { | |
// Init RestKit and Map Models | |
RKObjectManager *manager = [RKObjectManager managerWithBaseURLString:@"http://example.com/api"]; | |
manager.client.requestQueue.showsNetworkActivityIndicatorWhenBusy = YES; | |
[[RKClient sharedClient] setCachePolicy:RKRequestCachePolicyNone]; | |
[[RKClient sharedClient] setValue:[[NSUserDefaults standardUserDefaults] stringForKey:@"UUID"] forHTTPHeaderField:@"App-UUID"]; | |
RKLogConfigureByName("RestKit/Network*", RKLogLevelTrace); |
$weather = false; | |
if ( $this->Session->check('Auth.User.id') ) { | |
App::uses('User','Model'); | |
$UserModel = new User(); | |
$user = $UserModel->find('first',array('conditions'=>array('User.id'=>$this->Session->read('Auth.User.id')),'contain' => array('FarmleadProfile'))); | |
if ( !empty($user) && !empty($user['FarmleadProfile'])) { | |
// construct address | |
$address = 'Saskatoon/SK/Canada'; | |
$weather = $weatherLib->fetchWeather('autoip'); |
__block MDJTemplateDataSource *dataSource; | |
beforeEach(^{ | |
dataSource = [[MDJTemplateDataSource alloc] init]; | |
}); | |
it(@"has parent MDJDataSource", ^{ | |
[[[dataSource class] should] beMemberOfClass:[MDJDataSource class]]; | |
}); |
// install some dependencies | |
// npm install jsdom request growler | |
// | |
// run: node scrape.js | |
var jsdom = require('jsdom'), | |
request = require('request'), | |
growler = require('growler'); | |
console.log('init'); |
it(@"touch event mock setup", ^{ | |
UITouch *touchMock = [UITouch mock]; // this is important, it has the selector signature to cast the return type | |
CGPoint source = CGPointMake(5.0, 5.0); | |
[touchMock stub:@selector(locationInView:)andReturn:theValue(source)]; | |
NSSet *set = [NSSet setWithObject:touchMock]; | |
CGPoint pow = [touchMock locationInView:nil]; | |
[[theValue(pow.x) should] equal:5.0 withDelta:0.1]; | |
}); | |
// vs |
// this is a snip from a Behavior I wrote that overrides afterSave(...) from the AclBehavior. | |
// This solves having multiple instances of your model in the ACO/ARO trees. I'm not really sure "what" | |
// the point of updating an ACO/ARO is in the $created == true case is unless you have defined a single "Group" | |
// inheritance as they show in the docs. Clearly that isn't ideal for some setups, but changing the current | |
// implementation could break a lot of sites (I actually would want to see a complex case that proves that, I'm only | |
// "told" that is the case). At any rate, in my case I'll take care of updating all the other ACO/ARO's that are not | |
// at the default parent node for the model. | |
// This appears to be a purposeful limitation to basically allow "grouping" but not multiple grouping. In theory |