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
exports.watch = function(patterns, excludes, fileList, watchEvents) { | |
var options = { | |
ignorePermissionErrors: true, | |
ignored: createIgnore(excludes) | |
}; | |
var chokidarWatcher = new chokidar.FSWatcher(options); | |
watchPatterns(patterns, chokidarWatcher); | |
var bind = function(fn) { |
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
beforeEach(function() { | |
this.addMatchers({ | |
// | |
// ### function hasProperties expected | |
// #### @expected Array of Object or single Object with expected key value pairs. | |
// Custom matcher to verify that the actual object under test contains given | |
// properties with corresponding values. | |
// | |
// The matcher will fail if either the property does not exist, or the values do not match. |
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() { | |
var debounce = function (callback, wait) { | |
var timeout, | |
thisObj; | |
return function() { | |
var later = function() { | |
timeout = null; | |
callback.apply(thisObj); |
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() { | |
// Given an array of values, find all exact matches. | |
// If no matches are found, find the closest match. | |
// | |
// Returns an array of indices where matches occur | |
// If no exact match, a closest match is performed and returned as an array with one element | |
// | |
function search(values, desired) { |
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
- script | |
- build | |
- conf | |
- app | |
- css | |
- images | |
- js | |
- dashboard | |
- media | |
- 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
# checkout the root commit | |
git checkout <sha1-of-root> | |
# amend the commit | |
git commit --amend | |
# rebase all the other commits in master onto the amended root | |
git rebase --onto HEAD HEAD master |
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
- (void)animateProductImagesIn | |
{ | |
[self reset]; | |
CGFloat delayAmount = 0.2; | |
NSUInteger num = [self.productImages count]; | |
for (int i=0; i < num; i ++) | |
{ | |
UIImageView *view = [self.productImages objectAtIndex:i]; | |
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
Best design pattern for starting only one async operation and share signal result | |
https://github.com/ReactiveCocoa/ReactiveCocoa/issues/828 | |
http://stackoverflow.com/questions/14066651/how-to-using-reactivecocoa-to-transparently-authenticate-before-making-api-calls/14072445#14072445 | |
http://stackoverflow.com/questions/15075075/when-to-use-racreplaysubject-vs-racmulticastconnection | |
http://spin.atomicobject.com/2014/06/29/replay-replaylast-replaylazily/ |
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
#!/bin/bash | |
result=$(curl "http://www.gitignore.io/api/$1" 2>/dev/null) | |
if [[ $result =~ ERROR ]]; then | |
echo "Query '$1' has no match. See a list of possible queries with '$(basename "$0") list'" | |
elif [[ $1 = list ]]; then | |
echo "$result" | |
else | |
if [[ -f .gitignore ]]; then |
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
// | |
// Android you suck. Some of your versions don't dispatch | |
// a video ended event. So the player just hangs on the last frame. | |
// | |
// Observables from video element events | |
var timeObs = Rx.Observable.fromEvent(videoEl, 'timeupdate'); | |
var endedObs = Rx.Observable.fromEvent(videoEl, 'ended'); | |
var endOfVideoByTimeObs = timeObs |
OlderNewer