Skip to content

Instantly share code, notes, and snippets.

[:peanut, :butter, :and, :jelly][4,0] #=> []
[:peanut, :butter, :and, :jelly][5,0] #=> nil
@jesteracer
jesteracer / deploy.rb
Created July 6, 2012 21:29 — forked from mikhailov/0. nginx_setup.sh
Nginx+Unicorn (production-ready setup)
# Capistrano configuration
#
# require 'new_relic/recipes' - Newrelic notification about deployment
# require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production.
# set :deploy_via, :remote_cache - fetch only latest changes during deployment
# set :normalize_asset_timestamps - no need to touch (date modification) every assets
# "deploy:web:disable" - traditional maintenance page (during DB migrations deployment)
# task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP
resources :tlists do
member do
get 'complete'
get 'activate'
get 'draft'
end
end
resources :tdrafts, :controller => :tlists, :type => "Tdraft" do
member do
@jesteracer
jesteracer / rbenv-install-system-wide.sh
Created March 4, 2012 09:57 — forked from jnx/rbenv-install-system-wide.sh
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
class ClientPosition
constructor: ->
@latitude = $("#map_canvas").data('latitude')
@longitude = $("#map_canvas").data('longitude')
if navigator.geolocation
navigator.geolocation.getCurrentPosition ((position) ->
@latitude = position.coords.latitude
@longitude = position.coords.longitude
), (error) ->
console.log error
@jesteracer
jesteracer / mongoid-cheatsheet.md
Created November 16, 2011 21:04 — forked from icebreaker/mongoid-cheatsheet.md
Mongoid cheat sheet