Skip to content

Instantly share code, notes, and snippets.

View pawelniewie's full-sized avatar

Pawel Niewiadomski pawelniewie

View GitHub Profile

Zero downtime deploys with unicorn + nginx + runit + rvm + chef

Below are the actual files we use in one of our latest production applications at Agora Games to achieve zero downtime deploys with unicorn. You've probably already read the GitHub blog post on Unicorn and would like to try zero downtime deploys for your application. I hope these files and notes help. I am happy to update these files or these notes if there are comments/questions. YMMV (of course).

Other application notes:

  • Our application uses MongoDB, so we don't have database migrations to worry about as with MySQL or postgresql. That does not mean that we won't have to worry about issues with the database with indexes being built in MongoDB or what have you.
  • We use capistrano for deployment.

Salient points for each file:

@joshearl
joshearl / SublimeProjectExample.sublime-project
Created November 17, 2012 02:32
Sample Sublime project file with project-specific settings
{
"folders":
[
{
"path": "Leanpub/sublime-productivity",
"folder_exclude_patterns": ["epub_images", "convert_html", "preview", "published"],
"file_exclude_patterns": [".gitignore", "*.sublime*", "*Icon*"]
},
{
"path": "SublimeTextTips"
@chamerling
chamerling / quickhubhandler.m
Created December 12, 2011 11:06
OS X URL handler
- (void)registerURLHandler:(id) sender
{
NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
OSStatus httpResult = LSSetDefaultHandlerForURLScheme((CFStringRef)@"quickhubapp", (CFStringRef)bundleID);
NSLog(@"Result : %@", httpResult);
[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(getUrl:) forEventClass:kInternetEventClass andEventID:kAEGetURL];
}
@wtaysom
wtaysom / where_is.rb
Created September 23, 2011 08:57
A little Ruby module for finding the source location where class and methods are defined.
module Where
class <<self
attr_accessor :editor
def is_proc(proc)
source_location(proc)
end
def is_method(klass, method_name)
source_location(klass.method(method_name))