( Source: the mongoid cheatsheet )
class User
include Mongoid::Document
# lib/tasks/deploy.rake | |
namespace :deploy do | |
desc 'Deploy to staging environment' | |
task :staging do | |
exec 'mina deploy -f config/deploy/staging.rb' | |
end | |
end |
require File.join(File.dirname(__FILE__), 'deploy/nginx') | |
require File.join(File.dirname(__FILE__), 'deploy/log') | |
default_run_options[:pty] = true | |
set :ssh_options, { :forward_agent => true } | |
set :application, "appname" | |
set :repository, "git@giturl" | |
set :scm, :git |
// mithrilFire usage demo | |
// using firebase database "dinosaur-facts" | |
var Dinosaurs = { | |
model: function() { | |
// return a firebase reference to our database | |
return new Firebase('https://dinosaur-facts.firebaseio.com'); | |
}, | |
controller: function() { | |
var data = Dinosaurs.model(); |
( Source: the mongoid cheatsheet )
class User
include Mongoid::Document
#!/bin/sh | |
set -e | |
# Example init script, this can be used with nginx, too, | |
# since nginx and unicorn accept the same signals | |
# Feel free to change any of the following variables for your app: | |
TIMEOUT=${TIMEOUT-60} | |
APP_ROOT=/path/to/your/app/current | |
PID=$APP_ROOT/tmp/pids/unicorn.pid | |
ENVIRONMENT=production |
RAILS_ENV=production rake db:setup | |
# produces the error below.....hmmm.....it's a no-worky | |
psql:/yourprojectpath/yourproject/db/structure.sql:29: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory | |
# hstore postgresql extension needs to be installed, so.... | |
sudo apt-get install postgresql-contrib | |
# now your extension should be available to enable so log in with psql | |
psql -d yourproject_production -U yourdbuser -W |
#!/usr/bin/env ruby | |
# An HTTP/HTTPS/FTP file downloader library/CLI based upon MiniPortile's | |
# HTTP implementation. | |
# | |
# Author: Jon Maken | |
# License: 3-clause BSD | |
# Revision: 2012-03-25 23:01:19 -0600 | |
require 'net/http' | |
require 'net/https' if RUBY_VERSION < '1.9' |
/** | |
* Like, basically PERFECT scrollbars | |
*/ | |
/* | |
It's pure CSS. | |
Since a quick google search will confirm people going crazy about Mac OS Lion scrollbars... | |
this has no fade-out effect. | |
In Mac OS Lion, the lowest common denominator is always showing scrollbars by a setting. |
# Guide | |
# Configure the essential configurations below and do the following: | |
# | |
# Repository Creation: | |
# cap deploy:repository:create | |
# git add . | |
# git commit -am "initial commit" | |
# git push origin master | |
# | |
# Initial Deployment: |
http { | |
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m; | |
proxy_temp_path /var/tmp; | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
gzip on; | |
gzip_comp_level 6; |