Skip to content

Instantly share code, notes, and snippets.

@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@olivierbuffon
olivierbuffon / post-checkout
Created October 24, 2016 03:51
Git post-checkout hook: migrations & bundle autorun
#!/bin/sh
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
CHECKING_OUT_BRANCH=$3
OLD_BRANCH=$1
NEW_BRANCH=$2
@binarymax
binarymax / CraftyChess.txt
Last active November 29, 2015 22:00
Compile Crafty Chess on Mac OSX
Compiling crafty chess on MacOS, you get the following error:
-------------------------------------------------------------
~/apps/crafty/crafty-23.4:$ make darwin
/Applications/Xcode.app/Contents/Developer/usr/bin/make target=FreeBSD \
CC=gcc CXX=g++ \
CFLAGS='-Wall -pipe -O3' \
CXFLAGS='-Wall -pipe -O3' \
LDFLAGS= \
LIBS='-lstdc++' \
opt='' \
@cawel
cawel / ransack.rb
Last active December 16, 2015 14:29 — forked from RohanM/ransack.rb
# Patch for ransack (https://github.com/ernie/ransack) to use scopes
# Helps migrating from Searchlogic or MetaSearch
# Place this file into config/initializer/ransack.rb of your Rails 3.2 project
#
# Usage:
# class Debt < ActiveRecord::Base
# scope_ransackable :overdue
# scope :overdue, lambda { where(["status = 'open' AND due_date < ?", Date.today]) }
# end
#
@RohanM
RohanM / ransack.rb
Last active December 16, 2015 00:49 — forked from nilbus/ransack.rb
# Patch for ransack (https://github.com/ernie/ransack) to use scopes
# Helps migrating from Searchlogic or MetaSearch
# Place this file into config/initializer/ransack.rb of your Rails 3.2 project
#
# Usage:
# class Debt < ActiveRecord::Base
# scope_ransackable :overdue
# scope :overdue, lambda { where(["status = 'open' AND due_date < ?", Date.today]) }
# end
#