Skip to content

Instantly share code, notes, and snippets.

View fousa's full-sized avatar

Jelle Vandebeeck fousa

View GitHub Profile
@fousa
fousa / content.m
Created July 12, 2012 10:08
GCD Date Formatter
static NSDateFormatter *dateFormatter = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
dateFormatter = [NSDateFormatter new];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
});
return [dateFormatter dateFromString:self];
@fousa
fousa / content.m
Created July 12, 2012 10:06
Static Date Formatter
static NSDateFormatter *railsFormatter = nil;
if (railsFormatter == nil) {
railsFormatter = [[NSDateFormatter alloc] init];
[railsFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss'Z'"];
}
return [railsFormatter stringFromDate:self];
@fousa
fousa / gist:3093256
Created July 11, 2012 20:43
Lion Library
chflags nohidden ~/Library/
@fousa
fousa / gist:3093251
Created July 11, 2012 20:43
XCode .gitignore
# Xcode
build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
@fousa
fousa / gist:3093249
Created July 11, 2012 20:43
Remove All Gems
gem list | cut -d" " -f1 | xargs gem uninstall -aIx
@fousa
fousa / gist:3093239
Created July 11, 2012 20:41
.gitattributes
*.pbxproj -crlf -diff -merge
@fousa
fousa / gist:3093236
Created July 11, 2012 20:41
Create User MySQL
CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
@fousa
fousa / gist:3093233
Created July 11, 2012 20:40
Grant MySQL
GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' WITH GRANT OPTION;
@fousa
fousa / gist:3093231
Created July 11, 2012 20:40
Import MySQL
mysql -u user db_development < dump.sql
@fousa
fousa / gist:3093224
Created July 11, 2012 20:39
Create PSQL
createdb db_development