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/sh | |
XCODEUUID=`defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID` | |
defaults write ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/$1.xcplugin/Contents/Info DVTPlugInCompatibilityUUIDs -array-add $XCODEUUID |
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
[{"name":"Israel","dial_code":"+972","code":"IL"},{"name":"Afghanistan","dial_code":"+93","code":"AF"},{"name":"Albania","dial_code":"+355","code":"AL"},{"name":"Algeria","dial_code":"+213","code":"DZ"},{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"},{"name":"Andorra","dial_code":"+376","code":"AD"},{"name":"Angola","dial_code":"+244","code":"AO"},{"name":"Anguilla","dial_code":"+1 264","code":"AI"},{"name":"Antigua and Barbuda","dial_code":"+1268","code":"AG"},{"name":"Argentina","dial_code":"+54","code":"AR"},{"name":"Armenia","dial_code":"+374","code":"AM"},{"name":"Aruba","dial_code":"+297","code":"AW"},{"name":"Australia","dial_code":"+61","code":"AU"},{"name":"Austria","dial_code":"+43","code":"AT"},{"name":"Azerbaijan","dial_code":"+994","code":"AZ"},{"name":"Bahamas","dial_code":"+1 242","code":"BS"},{"name":"Bahrain","dial_code":"+973","code":"BH"},{"name":"Bangladesh","dial_code":"+880","code":"BD"},{"name":"Barbados","dial_code":"+1 246","code":"BB"},{"name":"Belarus","dial_code":"+375"," |
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/sh | |
ghc-pkg check --simple-output | xargs -n 1 ghc-pkg unregister --force |
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/sh | |
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages. | |
# ghc-pkg-clean -f cabal/dev/packages*.conf also works. | |
function ghc-pkg-clean() { | |
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` | |
do | |
echo unregistering $p; ghc-pkg $* unregister $p | |
done | |
} |
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
import Foundation | |
class Answer { | |
let questionId = 0 | |
let answerId = 0 | |
let answer: String? | |
} | |
public class Question { | |
let questionId = 0 |
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 slow_hash(str) { | |
var hash = 0, i, chr, len; | |
if (str.length === 0) return hash; | |
for (i = 0, len = str.length; i < len; i++) { | |
chr = str.charCodeAt(i); | |
hash = ((hash << 5) - hash) + chr; | |
hash |= 0; // Convert to 32bit integer | |
// max of integer in javascript is 2^53 | |
// http://stackoverflow.com/questions/307179/ |
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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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
// | |
// From http://stackoverflow.com/questions/4442126/how-to-draw-a-speech-bubble-on-an-iphone | |
// | |
void DrawPopupShapeInRect(CGRect rect, CGColorRef borderColor, CGColorRef backgroundColor, CGFloat borderRadius, CGFloat strokeWidth, CGFloat pointerWidth, CGFloat pointerHeight) | |
{ | |
CGRect currentFrame = self.bounds; | |
CGContextSetLineJoin(context, kCGLineJoinRound); | |
CGContextSetLineWidth(context, strokeWidth); |
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 | |
# run this in ~/Library/Logs/CrashReporter/MobileDevice | |
pth=${0%*/*} | |
cd "$pth" | |
#echo "$@" | |
if [ -z "$1" ]; then | |
find . -name "*.crash" | while read file; | |
do | |
echo "converting $file" |
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
desc 'Remove unused images' | |
task :clean_assets do | |
require 'set' | |
all = Set.new | |
used = Set.new | |
unused = Set.new | |
# White list | |
used.merge %w{Icon Icon-29 Icon-50 Icon-58 Icon-72 Icon-114} |
OlderNewer