by alexander white ©
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
// 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 |
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
# 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: ... |
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
#!/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 |