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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<trigger keyword="@string/your_voice_trigger"> | |
<constraints network="true" /> | |
</trigger> |
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
if(mLiveCard == null){ | |
//Publish your card | |
}else{ | |
mLiveCard.unpublish(); | |
//Set liveCard's view | |
mLiveCard.setNonSilent(true); | |
mLiveCard.publish(); | |
} |
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 'RestKit', :podspec => 'local/path/to/RestKit.podspec' |
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
grep -R subspec * | cut -d' ' -f1 | uniq -c | sort |
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
package Reddit; | |
import java.util.LinkedList; | |
import java.util.List; | |
import com.google.gson.Gson; | |
import com.google.gson.JsonArray; | |
import com.google.gson.JsonElement; | |
import com.google.gson.JsonObject; | |
import com.google.gson.JsonParser; |
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 NSImage (RSShading) | |
- (NSImage *) tintedImage | |
{ | |
NSImage* newImage = [[[NSImage alloc] initWithSize:[self size]] autorelease]; | |
NSRect imageRect = {NSZeroPoint, [self size]}; | |
NSColor *color = [NSColor blackColor]; | |
[newImage lockFocus]; | |
[[color colorWithAlphaComponent: 0.25] set]; |
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
// This sqlite3_exec limits the database to 50 DB pages (about 1.5Kb each) | |
// Huge memory win on iPhone. | |
if(sqlite3_exec(myDatabsae, "PRAGMA CACHE_SIZE=50", NULL, NULL, NULL) != SQLITE_OK) | |
NSLog(@"Couldn't set cache size: %s", sqlite3_errmsg([self.database sql])); |
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)awakeFromNib { | |
NSView *contentView = [window contentView]; | |
for (int i = 0; i < 10; i++) { | |
NSTextField *label = [[NSTextField alloc] initWithFrame: NSMakeRect(10, i * 40, 120, 30)]; | |
[label setStringValue:@"foo"]; | |
[contentView addSubview: label]; | |
NSTextField *text = [[NSTextField alloc] initWithFrame: NSMakeRect(100, i * 40, 120, 30)]; | |
[text setStringValue:@"foo"]; | |
[contentView addSubview: text]; |
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
NSString *bundleIDString = [[NSBundle mainBundle] bundleIdentifier]; |
OlderNewer