Skip to content

Instantly share code, notes, and snippets.

View tbalthazar's full-sized avatar
👻
chasing ghosts

Thomas Balthazar tbalthazar

👻
chasing ghosts
View GitHub Profile
@tbalthazar
tbalthazar / gist:1104441
Created July 25, 2011 15:53 — forked from omz/gist:1102091
Creating arbitrarily-colored icons from a black-with-alpha master image (iOS)
// Usage example:
// input image: http://f.cl.ly/items/3v0S3w2B3N0p3e0I082d/Image%202011.07.22%2011:29:25%20PM.png
//
// UIImage *buttonImage = [UIImage ipMaskedImageNamed:@"UIButtonBarAction.png" color:[UIColor redColor]];
// .h
@interface UIImage (IPImageUtils)
+ (UIImage *)ipMaskedImageNamed:(NSString *)name color:(UIColor *)color;
@end
@tbalthazar
tbalthazar / backup.rake
Created November 11, 2009 11:22 — forked from nickmerwin/backup.rake
backup heroku db to s3
# Heroku S3 Database backup task
# by Nick Merwin (Lemur Heavy Industries) 10.08.09
# * dumps db to yaml, gzip's and sends to S3
#
# Setup:
# 1) replace APP_NAME and BACKUP_BUCKET with your info
# 2) add config/s3.yml like so (same as Paperclip's):
# production:
# access_key_id: ...
# secret_access_key: ...
#!/usr/bin/env ruby
#
# Find bloating passengers and kill them gracefully. Run from cron every minute.
#
MEM_LIMIT = ARGV[0].to_i || 500
module Process
def self.running?(pid)
begin