#Mongo
###Install
brew install mongo
###Run as process (not as service)
To have launchd start mongodb at login:
ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
| #!/bin/bash | |
| for image in `find . -iname "*.jpg" -o -iname ".jpeg"` | |
| do | |
| convert "$image" -font Arial -pointsize 82 -fill red -annotate +100+100 %[exif:DateTimeOriginal] "$image" | |
| done |
#Mongo
###Install
brew install mongo
###Run as process (not as service)
To have launchd start mongodb at login:
ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
| NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://www.yourserver.com/yourRestServer.php"] cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:100]; | |
| [request setHTTPMethod:@"GET"]; | |
| [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { | |
| if(!error) | |
| { | |
| @try { | |
| __autoreleasing NSError *parsingError = [[NSError alloc] init]; | |
| NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&parsingError]; | |
| NSLog(@"NSJSONSerialization Dict: %@", dict); |
I wanted a way to scale up and down the dynos in Heroku based on time of day.
To do so, I added the scheduler add-on to heroku heroku addons:add scheduler
In my Rails app, I added the scale_dynos.rake file in /lib/tasks/ and the following line to the Gemfile:
gem 'heroku-api', '~> 0.3.17', :require => false
Now I can run heroku run rake scale_dynos:up (and down) through the command line, as well as scheduling the command rake scale_dynos:up in the Scheduler add-on.
a