This file contains hidden or 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
// This is my configuration for Phoenix <https://github.com/sdegutis/Phoenix>, | |
// a super-lightweight OS X window manager that can be configured and | |
// scripted through Javascript. | |
var mNone = [], | |
mCmd = ['cmd'], | |
mShift = ['shift'], | |
nudgePixels = 10, | |
padding = 0, | |
previousSizes = {}; |
This file contains hidden or 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 http = require("http") | |
var query = require('querystring'); | |
var term = process.argv[2]; | |
var DEBUG = false; | |
var options = { | |
host: 'search.musicbrainz.org', | |
path: '/ws/2/artist/?fmt=json&query=' + query.escape(term) | |
}; |
This file contains hidden or 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 | |
# Copy the Artist tag to Artist Album. | |
# Requires id3v2 [brew install id3vw] | |
# | |
DIR="500 Greatest Songs" | |
find "$DIR" -name "*mp3" | while read song | |
do | |
artist=`id3v2 --list "$song" | grep TPE1 | cut -d: -f 2 | sed -e 's/^ //'` |
This file contains hidden or 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
/* Xcode configuration | |
OTHER_CFLAGS=-I$(HOME)/Library/PonyDebugger/include -DWITH_PONYD=1 | |
OTHER_LDFLAGS=-L$(HOME)/Library/PonyDebugger -lSocketRocket -lPonyDebugger -licucore -ObjC | |
*/ | |
#if WITH_PONYD | |
#import <PonyDebugger/PonyDebugger.h> | |
#endif | |
#if WITH_PONYD |
This file contains hidden or 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
dispatch_async(dispatch_get_main_queue(), ^{ | |
[(CALayer *)[self.window layer] setSpeed:.2]; | |
}); |
This file contains hidden or 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
find * -name "*srt" | while read file;do file -I "$file" | grep 8859;if [ $? -eq 0 ];then iconv -f latin1 -t utf8 "$file" > "_${file}"; mv "_${file}" "$file";fi;done |
This file contains hidden or 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
/* | |
2013-09-29 21:23:26.468 perf[3911:60b] Sep 26, 2013, 8:47 AM confidence high type walking steps 16 | |
2013-09-29 21:23:26.474 perf[3911:60b] Sep 26, 2013, 8:56 AM confidence medium type walking steps 0 | |
2013-09-29 21:23:26.492 perf[3911:60b] Sep 26, 2013, 9:08 AM confidence high type stationary steps 25 | |
... | |
*/ | |
if([CMMotionActivityManager isActivityAvailable]) { | |
CMMotionActivityManager *cm = [[CMMotionActivityManager alloc] init]; | |
CMStepCounter *sc = [[CMStepCounter alloc] init]; |
This file contains hidden or 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/sh | |
# | |
# Download and install a single iOS provisioning profile | |
# Requires https://github.com/nomad/cupertino | |
# | |
# Usage | |
# - Login to your account once: | |
# ios login | |
# - Configure TEAM and PROFILE (instructions below) | |
# - Run update_provisioning_profile.sh at anytime, usually after adding/removing devices to the profile |
This file contains hidden or 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
[self.collectionView aspect_hookSelector:@selector(touchesBegan:withEvent:) | |
withOptions:AspectPositionAfter | |
usingBlock:^(id<AspectInfo> aspectInfo, NSSet *touches, UIEvent *event) { | |
NSLog(@"touchesBegan:withEvent:\n%@\n%@\n", touches, event); | |
} | |
error:&error]; | |
[self aspect_hookSelector:@selector(pointInside:withEvent:) | |
withOptions:AspectPositionAfter |
This file contains hidden or 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
# http://effbot.org/zone/pil-comparing-images.htm | |
from PIL import Image | |
import sys | |
import math | |
import operator | |
if len(sys.argv) < 3: | |
print "<image_path> <image_path>".format(sys.argv[0]) | |
sys.exit(1) |