Skip to content

Instantly share code, notes, and snippets.

@benedikt
benedikt / gist:1977438
Created March 5, 2012 08:21
Protect all fields against mass assignment in a mongoid document by default
module Mongoid
module MassAssignmentSecurity
extend ActiveSupport::Concern
included do
attr_accessible nil
end
end
module Document
@ehoch
ehoch / gist:1960548
Created March 2, 2012 19:17
Puma / DJ Procefile on Heroku
web: bundle exec puma -p $PORT
worker: bundle exec rake jobs:work
@metaphox
metaphox / gist:1644401
Created January 20, 2012 01:34
Fixing the postgresql initdb fatal shared memory error on Leopard
Fixing the postgresql initdb fatal shared memory error on Leopard
Published Tue 18 December 2007 11:09 (+1300)
Tagged
software (43 posts and 3 photos)
mac os x (6 posts)
When doing the post-install setup of postgresql default database using initdb, you may hit this error:
FATAL: could not create shared memory segment: Cannot allocate memory
DETAIL: Failed system call was shmget(key=1, size=1646592, 03600).
@thbar
thbar / vagrant-capistrano
Created December 13, 2011 09:45 — forked from fadhlirahim/vagrant-capistrano
Vagrant capistrano config bit
# Don't forget to run this vagrant command first
# vagrant ssh-config >> ~/.ssh/config
set :user, 'vagrant'
set :run_method, :sudo
role :app, '33.33.33.10'
ssh_options[:keys] = `vagrant ssh_config | grep IdentityFile`.split.last
@defunkt
defunkt / clients.md
Created April 18, 2010 14:09
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@isaacs
isaacs / comma-first-var.js
Created April 6, 2010 19:24
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",