gem install thor
mkdir -p ~/vagrants && cd ~/vagrants
curl -LO https://raw.github.com/gist/1528832/vagrantify
chmod 755 vagrantify
./vagrantify init webserver
| # | |
| # Some helper methods | |
| # | |
| app = | |
| activePage: -> | |
| $(".ui-page-active") | |
| reapplyStyles: (el) -> |
| # Copyright (c) 2012, Thomas Stachl <[email protected]> | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and | |
| # associated documentation files (the "Software"), to deal in the Software without restriction, | |
| # including without limitation the rights to use, copy, modify, merge, publish, distribute, | |
| # sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is | |
| # furnished to do so, subject to the following conditions: | |
| # | |
| # The above copyright notice and this permission notice shall be included in all copies or | |
| # substantial portions of the Software. |
| #! /bin/sh | |
| PATH=/sbin:/usr/sbin:/bin:/usr/bin | |
| DESC="Unicorn server" | |
| NAME=unicorn | |
| RVM=/usr/local/rvm/bin/rvm | |
| RVM_EXEC_ARGS="1.9.3@application exec" | |
| RAILS_DIR=/data/application | |
| DAEMON=$RVM | |
| DAEMON_ARGS="$RVM_EXEC_ARGS $RAILS_DIR/bin/unicorn -c $RAILS_DIR/config/unicorn.rb -E staging -D" |
| /* | |
| ** Client side - /public/src/app.js | |
| */ | |
| var myApp = { | |
| // Collections | |
| Collections: { | |
| list: Backbone.Collection.extend() | |
| }, | |
| // Views |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| /** | |
| * A useful little pagination collection extension. Handles two | |
| * types of collections: | |
| * 1. Those where the number of pages is discoered on first page | |
| * 2. Those whose number of pages is known in advance. | |
| * Used by startup Collection and Trends collection. | |
| */ | |
| ST.Collections.PaginatedCollection = Backbone.Collection.extend({ | |
| initialize : function(attributes, options) { |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.
Eventually platforms outgrow the single-source-tree model and become distributed systems. A common pattern in these distributed systems is distributed composition via event buffering. Here we motivate and describe this event buffering pattern.
| #This is the "site config" for nginx | |
| upstream django { | |
| # Distribute requests to servers based on client IP. This keeps load | |
| # balancing fair but consistent per-client. In this instance we're | |
| # only using one uWGSI worker anyway. | |
| ip_hash; | |
| server unix:/tmp/uwsgi.sock; | |
| } | |
| server { |