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
# Add this snippet to the top of your playbook. We'll refer to this as "your-playbook.yml" | |
# It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
# [email protected] | |
# Assumes that you are not running as root | |
# Run via: "ansible-playbook --ask-become-pass your-playbook.yml" | |
# v1.1 by [email protected] / @louielouie | |
- hosts: all | |
gather_facts: False | |
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
// 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
@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]; |