Skip to content

Instantly share code, notes, and snippets.

View bustardcelly's full-sized avatar
🏠
Working from home

Todd Anderson bustardcelly

🏠
Working from home
View GitHub Profile
@bustardcelly
bustardcelly / .gitignore
Last active December 2, 2015 01:17
dirseal
*.json
@bustardcelly
bustardcelly / node-watcher.js
Created May 6, 2014 02:00
Little script to run node on change to single file target
#!/usr/bin/env node
var path = require('path');
var watch = require('node-watch');
var parseArgs = require('minimist');
var argv = parseArgs(process.argv.slice(2));
var exec = require('child_process').spawn;
var trimNewLine = /\s+$/;
require('colors');
@bustardcelly
bustardcelly / gist:9437051
Created March 8, 2014 18:56
Print iOS console error in After Scenario on failure using Cucumber + Calabash-ios
After do |scenario|
if(scenario.failed?)
$stdout.print "\n[Fail] #{scenario.exception.message}\n----------\n"
system("tail -r -100 \"#{ENV['HOME']}/Library/Logs/iOS Simulator/7.0.3/system.log\" | grep -A1000 Error -i -m1")
$stdout.print "----------\n"
end
unless @calabash_launcher.calabash_no_stop?
calabash_exit
if @calabash_launcher.active?
@calabash_launcher.stop
@bustardcelly
bustardcelly / zombie_patch.js
Created January 29, 2014 14:50
zombiejs patch for non-trapping of link event to allow for bubble up when using SAP libraries.
/**
* We are using page.js for client routing.
* We are using zombie.js as a headless browser during testing.
*
* zombie.js traps the click event of an A element and prevents it from bubbling up to the window.
* page.js listens for 'click' on window to determine location routing.
*
* As such, they conflict and setup for changing location within a SAP within a test will return a 404.
* Load this in as a patch for zombie within a feature module that requires a change to the location.
*/
@bustardcelly
bustardcelly / ModelDependentAMD.js
Created November 28, 2012 21:54
$.trigger + Object.create + Object.describeProperties for property change events
define(['jquery', 'SomeAMDModel'], function($, modelFactory) {
var model = modelFactory.create();
$(model).on('property-change', function(event) {
console.log( 'propertyChange: ' + JSON.stringify( event, null, 4 ) );
});
model.name = 'Rescue Pack!';
return model;
@bustardcelly
bustardcelly / DeferredGroup.as
Created November 4, 2011 20:58
Deferred IViewElement attachment to a subclass of Group on which children are defined in MXML markup.
package
{
import flash.events.Event;
import mx.events.FlexEvent;
import spark.components.Group;
/**
* Use the deferredElements property as the modifier that is handed the list of IVisualElements defined in MXML.
@bustardcelly
bustardcelly / LinkedListIterator.as
Created July 19, 2011 08:44
A lightweight iterator for the LinkedList of Flex SDK
/**
* <p>Original Author: toddanderson</p>
* <p>Class File: LinkedListIterator.as</p>
* <p>Version: 0.1</p>
*
* <p>Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is