Skip to content

Instantly share code, notes, and snippets.

@daffydowden
daffydowden / gist:37ed963fc090fce8e106e0bd967f0095
Created December 23, 2017 16:06 — forked from giannisp/gist:ebaca117ac9e44231421f04e7796d5ca
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

Keybase proof

I hereby claim:

  • I am daffydowden on github.
  • I am richarddowden (https://keybase.io/richarddowden) on keybase.
  • I have a public key whose fingerprint is 0D87 4FF5 439E A840 44B6 6F0B 005D B4FB 41F5 81D4

To claim this, I am signing this object:

@daffydowden
daffydowden / dabblet.css
Created April 18, 2012 10:36 — forked from LeaVerou/dabblet.css
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@daffydowden
daffydowden / README.md
Created April 16, 2012 09:30 — forked from tjogin/README.md
Configuration file to use PHP with Ruby rack

Installation

First you need php-cgi, i used brew with Formula below:

$ curl -O https://raw.github.com/gist/1194269/7ae1709453a8a19ce9c030bf41d544dd08d96d85/php.rb
$ mv php.rb `brew --prefix`/Library/Formula
$ brew install php --with-mysql

Second, install this ruby gems:

@daffydowden
daffydowden / commands
Created March 1, 2012 10:40
Linux commands that I always forget...
# List all users
cat /etc/passwd | cut -d: -f1
# List all non-system users
awk -F: '{if ($3>=500 && $3<=1000) print $1}' /etc/passwd
# List all groups
cat /etc/group | cut -d: -f1
# Add an existing user to a group - http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/
# usermod -a -G ftp tony
@daffydowden
daffydowden / .rvmrc
Created January 2, 2012 12:10
.rvmrc file creation
rvm use [version]@[directory] --create --rvmrc
# From: http://onelinetidbits.posterous.com/rvm-automagically-create-rvmrc
@daffydowden
daffydowden / spree_setup.rb
Created November 16, 2011 20:33
Spree setup config. Place this within config/initializers
# Spree setup instructions
# Setup the default preferences
if Preference.table_exists?
# Site defaults
Spree::Config.set(:site_name => 'Classy Site Name')
Spree::Config.set(:default_seo_title => 'Marketing Stuff')
Spree::Config.set(:default_meta_description => 'Longer Marketing Stuff')
Spree::Config.set(:default_meta_keywords => 'Marketing, Stuff')
➜ UCA git:(master) ✗ rake db:schema:load --trace
/Users/Richard/Developer/.rvm/gems/ruby-1.9.2-p180@spinnaker_uca/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Mysql2::Error: Table 'uca_development.contributortypes' doesn't exist: SHOW FIELDS FROM `contributortypes`
/Users/Richard/Developer/.rvm/gems/ruby-1.9.2-p180@spinnaker_uca/gems/activerecord-3.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:283:in `query'
/Users/Richard/Developer/.rvm/gems/ruby-1.9.2-p180@spinnaker_uca/gems/activerecord-3.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:283:in `block in execute'
/Users/Richard/Developer/.rvm/gems/ruby-1.9.2-p180@spinnaker_uca/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:244:in `block in log'
@daffydowden
daffydowden / Closure
Created September 15, 2011 18:59
JS Masterclass - exercise 2
(function(scope){
// Code
var index;
function log(){
console.log(index);
}
function iterate(){
log();
@daffydowden
daffydowden / Gemfile
Created August 15, 2011 19:10
Error I'm getting using spree with Rails 3.1
source 'http://rubygems.org'
# Bundle edge Rails instead:
gem 'rails', '3.1.0.rc5', :git => "git://github.com/rails/rails", :branch => "3-1-stable"
gem 'mysql2'
gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31'
gem 'devise'
gem 'spree'