Skip to content

Instantly share code, notes, and snippets.

View holodigm's full-sized avatar

Kym McInerney holodigm

View GitHub Profile
@chbrown
chbrown / _upgrade-pg9.4-to-pg9.5.md
Last active October 7, 2021 13:57
Upgrade PostgreSQL 9.4 to 9.5 on Mac OS X with Homebrew

First, check your current config (example output in homebrew.mxcl.postgresql.plist.xml lower down in this gist):

cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Most importantly, note the -D /usr/local/var/postgres argument.

Second, shut down your current PostgreSQL.

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@niw
niw / rubygems_server.rb
Created October 29, 2013 03:16
Running rubygems server on localhost.
#!/usr/bin/env ruby
require 'webrick'
require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/exceptions'
REPOSITORY_ROOT = File.expand_path("../", __FILE__)
# Update index
@kcowgill
kcowgill / mirror_cheater.sh
Created May 6, 2013 16:30
Shell script for mirroring rubygems.org. Forcibly downloads quick/Marshal.4.8/${GEM}spec.rz, and all the indices (to prevent having to attempt (and subsequently fail - we just can't make it work) to generate_index ourselves). N.B. $MIRRORSCRIPT refers to a ruby script to fetch new gems similar to the script located at the following URL: http://h…
#!/bin/bash
# define $SHELL_VARS here
report_error () {
MESSAGE=$1
SUBJECT=$2
echo "$MESSAGE" | $MAILPROGRAM --subject="$SUBJECT" --toList=$EMAIL
}
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
class ApplicationController < ActionController::Base
...
# FORCE to implement content_for in controller
def view_context
super.tap do |view|
(@_content_for || {}).each do |name,content|
view.content_for name, content
end
end
end