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
from time import sleep | |
import RPi.GPIO as GPIO | |
from sys import exit | |
GPIO.setmode(GPIO.BCM) | |
pins = [18,23,24,25] | |
[GPIO.setup(pin, GPIO.IN) for pin in pins] |
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-build-bump.sh | |
# @desc Auto-increment the build number every time the project is run. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |
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
import pygame.mixer | |
from time import sleep | |
import RPi.GPIO as GPIO | |
from sys import exit | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(24, GPIO.IN) | |
print "Ready." |
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
#import <Foundation/Foundation.h> | |
@interface NSObject(BasukeAddition) | |
- (id)performSelectorIfExists:(SEL)aSelector; | |
- (id)performSelectorIfExists:(SEL)aSelector withObject:(id)object; | |
- (id)performSelectorIfExists:(SEL)aSelector withObject:(id)object1 withObject:(id)object2; | |
@end |
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
# | |
# python drive.py "origin" ["waypoint" ... ] "destination" | |
# | |
# i.e. python drive.py "Union Square, San Francisco" "Ferry Building, San Francisco" 'Bay Bridge' SFO | |
import sys, json, urllib2, md5, os.path, pprint | |
from math import radians, sin, cos, atan2, pow, sqrt | |
from urllib import quote_plus | |
from xml.sax.saxutils import escape | |
from optparse import OptionParser |
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
set t to "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
set t to t & t & t & t & t & t & t & t | |
set t to t & t & t & t & t & t & t & t | |
set t to t & t & t & t & t & t & t & t | |
set t to t & t & t & t & t & t & t & t | |
set t to t & t & t & t & t & t & t & t | |
set t to t & t & t & t & t & t & t & t | |
set thePath to choose file name default name "stupid big data" default location (path to temporary items) |
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
- (void)testIndexPathEquality { | |
NSIndexPath *ip1 = [NSIndexPath indexPathForRow:0 inSection:0]; | |
NSIndexPath *ip2 = [NSIndexPath indexPathForRow:0 inSection:0]; | |
STAssertTrue([ip1 isEqual:ip2], @"indexpath の比較"); | |
} |
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
+ (NSString *)stringWithGUID { | |
CFUUIDRef uuid = CFUUIDCreate(nil); | |
NSString *str = (NSString*)CFUUIDCreateString(nil, uuid); | |
CFRelease(uuid); | |
return [str autorelease]; | |
} |