Skip to content

Instantly share code, notes, and snippets.

@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
@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).
@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
@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
require 'RMagick'
require 'capybara'
require 'launchy'
module Capybara::Recording
def start_recording
system "rm -f tmp/*"
end
def save_recording
@bylatt
bylatt / gist:4971506
Last active September 16, 2018 16:58
My .bash_profile setup on OS X. Modified from Mark Otto's bash style (http://markdotto.com/2013/01/13/improved-terminal-hotness/) by adding git color for status.
alias ls='ls -Glah'
alias web='open -a Safari.app'
alias mail='open -a Mail.app'
alias todo='open -a Reminders.app'
git_branch () {
if git rev-parse --git-dir >/dev/null 2>&1
then echo -e "" [$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')]
else
echo ""
fi
@niravmehta
niravmehta / kue_cleanup.js
Created July 30, 2013 11:57
Cleanup script for Kue job queueing system in Node.js. Deletes failed, active and completed jobs after specified time. Can run on command line directly with "node kue_cleanup". Requires Kue installed :-)
var kue = require('kue'),
jobs = kue.createQueue(),
util = require('util'),
noop = function() {};
jobs.CLEANUP_MAX_FAILED_TIME = 30 * 24 * 60 * 60 * 1000; // 30 days
jobs.CLEANUP_MAX_ACTIVE_TIME = 1 * 24 * 60 * 60 * 1000; // 1 day
jobs.CLEANUP_MAX_COMPLETE_TIME = 5 * 24 * 60 * 60 * 1000; // 5 days
jobs.CLEANUP_INTERVAL = 5 * 60 * 1000; // 5 minutes
@jrochkind
jrochkind / gist:2161449
Created March 22, 2012 18:40
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@ServerlessBot
ServerlessBot / IAMCredentials.json
Last active December 20, 2023 16:50
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
@superjose
superjose / .gitlab-ci.yml
Last active February 19, 2024 10:22
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.