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
// http://stackoverflow.com/questions/1560081/how-can-i-create-a-uicolor-from-a-hex-string | |
+ (UIColor *) colorWithHex:(int)hex { | |
return [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16))/255.0 | |
green:((float)((hex & 0xFF00) >> 8))/255.0 | |
blue:((float)(hex & 0xFF))/255.0 alpha:1.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
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
IMDB250TallyDirectors.py | |
Created by Jin Budelmann on 2012-08-03. | |
""" | |
import sys | |
import os |
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
IMDB250TallyDirectors.py | |
Created by Jin Budelmann on 2012-08-03. | |
""" | |
import sys | |
import os |
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
@implementation MySingleton | |
+ (MySingleton*)singleton { | |
static MySingleton* __singleton = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
__singleton = [[MySingleton alloc] init]; | |
}); | |
return __singleton; | |
} |
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 <objc/runtime.h> | |
#define ASSOCIATIVE_PROPERTY(GET_NAME, SET_NAME, TYPE, ASSOCIATION_POLICY) \ | |
static char GET_NAME##Key; \ | |
- (TYPE) GET_NAME \ | |
{ \ | |
return objc_getAssociatedObject(self, & GET_NAME##Key); \ | |
} \ | |
\ | |
- (void) SET_NAME:(TYPE)value\ |
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
int n1 = 320; | |
int n2 = 480; | |
simplifyRatio(&n1, &n2); | |
printf("%d %d", &n1, &n2); | |
int highestCommonFactor(int n1, int n2) { | |
int remainder = n1%n2; |
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
//receive loop(timeout=1000ms) | |
long long starttime = [self currentTimeMillis]; | |
while(true){ | |
//timeout check | |
long long readTimeout = SEND_RESPONSE_TIMEOUT - ([self currentTimeMillis] - starttime); | |
if(readTimeout < 0){ | |
break; | |
} | |
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
Pod::Spec.new do |s| | |
s.name = 'ZBarSDK' | |
s.version = '1.3.1' | |
s.platform = :ios | |
s.license = 'GNU LGPL 2.1' | |
s.summary = 'QR and barcode scan library.' | |
s.homepage = 'http://zbar.sourceforge.net/' | |
s.author = { 'Jeff Brown' => '[email protected]' } | |
s.source = { :git => 'https://github.com/ZBar/ZBar.git', :tag => 'iPhoneSDK-1.3.1' } |
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
sudo killall iTunes | |
sudo rm -rf /Applications/iTunes.app/ | |
osascript -e 'tell application "System Events" to delete login item "iTunesHelper"' |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>DVTConsoleDebuggerInputTextColor</key> | |
<string>0.727544 0.222335 0 1</string> | |
<key>DVTConsoleDebuggerInputTextFont</key> | |
<string>Menlo-Bold - 11.0</string> | |
<key>DVTConsoleDebuggerOutputTextColor</key> | |
<string>0.443313 0.509062 0.518274 1</string> |
OlderNewer