Skip to content

Instantly share code, notes, and snippets.

View michael-harrison's full-sized avatar

Michael Harrison michael-harrison

View GitHub Profile
@michael-harrison
michael-harrison / hash.md
Last active August 29, 2015 13:57
Hash to hash, dust to dust, experiment we must

Just had a quick look at the Ruby source and it looks like it doesn't compare the hash but uses the key object's == method to identify the right key. So to test the theory I did some experiments:

2.0.0-p247 :010 > test = {}
 => {} 
2.0.0-p247 :011 > a = [1,2]
 => [1, 2] 
2.0.0-p247 :012 > test[a]
 => nil 
2.0.0-p247 :013 > test[a] = 'cool'

=> "cool"

@michael-harrison
michael-harrison / test_file_existance.rb
Last active August 29, 2015 13:57
RSpec Test Patterns
# Test the existance of a file after a method call
it('will create a file') do
expect { subject.create_the_file }.to change { File.exists? my_file }.from(false).to(true)
end
@michael-harrison
michael-harrison / ereserve_developer_position.md
Created April 23, 2014 22:57
Developer Position at eReserve

We are adding to our Australian based development team and are on the hunt for developers who would love the opportunity to work in a highly collaborative and productive environment.

We are looking for developers who are responsive, take pride in their work, are passionate about delivering quality code, working swiftly and efficiently and improving the user experience.

eReserve has developed reading list, workflow for study materials management processes and copyright reporting for the education sector that help improve efficiency, lower costs and reduce risk of copyright violation. We are seeking developers to help us refine our product and implement features that have arisen from our close customer collaboration. Our product is aimed at both the Australian and global education markets and is aimed at helping educators efficiently create reading lists, manage and report on copyright materials use and lower the cost of study materials management.

We are looking for developers wi

@michael-harrison
michael-harrison / angular_road.md
Last active August 29, 2015 14:05
Rails & the Angular road: Beginnings

This article expects that you already have done the 101 AngularJS journey. If you're new to AngularJS then you'd best checkout the AngularJS Tutorial or Code Academy - AngularJS Patterns Tutorial(NB: this is for Angular 1.0.6) before continuing with this article. What we're really focusing on here are the decisions I've made and nuances discovered during the transition of a Rails app with the least resistance using the following stack:

  • Rails 4.0.x
  • Haml
  • Sass
  • Coffee
  • Devise with CanCan
  • jQuery
  • Twitter Bootstrap
  • PostgeSQL
@michael-harrison
michael-harrison / git_cheet_sheet.md
Last active August 29, 2015 14:07
Git Flow Cheat Sheet

Installation

brew install git-flow

Configuration

Following are the command to setup a new repo with git-flow

mkdir new_repo_folder

git-flow init -d

@michael-harrison
michael-harrison / gist:5140611
Last active December 14, 2015 19:59
Creating a CentOS 6.3 with Puppet VM with Vagrant and VirtualBox
# Download and install VirtualBox (see https://www.virtualbox.org/wiki/Downloads) in your flavour of OS
# Download and install Vagrant (see http://downloads.vagrantup.com/) in your flavour of OS
# Get the box from Puppet Labs
# For other boxes check out http://puppet-vagrant-boxes.puppetlabs.com/ and http://www.vagrantbox.es/
vagrant box add centos63 http://puppet-vagrant-boxes.puppetlabs.com/centos-63-x64.box
# Init you new VM
mkdir my_vm
cd my_vm
@michael-harrison
michael-harrison / with_specified_private_network.log
Last active December 18, 2015 07:19
Logging from Vagrant file with network specified: config.vm.network :private_network, ip: '10.202.202.10'
$ VAGRANT_LOG=DEBUG vagrant up
INFO global: Vagrant version: 1.2.3.dev
DEBUG global: Loading core plugin: /Users/neodynamic/.rvm/gems/ruby-1.9.3-p392@bb_duster/bundler/gems/vagrant-ba242cd97881/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: /Users/neodynamic/.rvm/gems/ruby-1.9.3-p392@bb_duster/bundler/gems/vagrant-ba242cd97881/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: /Users/neodynamic/.rvm/gems/ruby-1.9.3-p392@bb_duster/bundler/gems/vagrant-ba242cd97881/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: /Users/neodynamic/.rvm/gems/ruby-1.9.3-p392@bb_duster/bundler/gems/vagrant-ba242cd97881/plugins/commands/init/plugin.rb
INFO manager: Registered plugin: init command
@michael-harrison
michael-harrison / gist:6254595
Last active December 21, 2015 05:09
OSX PHP Development Setup
# PHP Installation
# ----------------
# Installed via phpbrew https://github.com/c9s/phpbrew
phpbrew install php-5.3.25 +default
phpbrew ext install openssl
phpbrew ext install mycrypt
# MySQL Installation
# ------------------
# Installed via brew http://brew.sh/
@michael-harrison
michael-harrison / ssh_sessions.md
Created July 11, 2017 23:01
SSH Session persistence

Add this ServerAliveInterval 60 to your ~/.ssh/config

@michael-harrison
michael-harrison / ssh_sessions.md
Created July 11, 2017 23:01
SSH Session persistence

Add this ServerAliveInterval 60 to your ~/.ssh/config