Skip to content

Instantly share code, notes, and snippets.

View michel's full-sized avatar

Michel de Graaf michel

View GitHub Profile
@michel
michel / beequip.rb
Created November 2, 2017 11:55
BEEQUIP vacancy
```class Candidate
attr_accessor :ambition, :location, :education, :skills
def initialize person
@ambition = person.ambition
@location = person.location
@education = person.education
@skills = person.skills
end
end
@michel
michel / keybase.md
Created March 4, 2015 09:09
keybase.md

Keybase proof

I hereby claim:

  • I am michel on github.
  • I am micheldegraaf (https://keybase.io/micheldegraaf) on keybase.
  • I have a public key whose fingerprint is D49B 05DA 9775 7124 C438 6F14 B676 F887 FCC9 B60E

To claim this, I am signing this object:

@michel
michel / gist:7e2c210b973123220ec8
Created January 5, 2015 11:38
jump to alternative language file in rails
function EditAlternativeLocal()
let filename = bufname("%")
if filename =~ "\.nl\.yml"
let alt_filename = substitute(filename, ".nl.yml", ".en.yml", "g")
execute "e " . alt_filename
elseif filename =~ "\.en\.yml"
let alt_filename = substitute(filename, ".en.yml", ".nl.yml", "g")
execute "e " . alt_filename
endif
endfunction
#!/bin/bash
# Update and upgrade packages
sudo apt-get update && sudo apt-get upgrade
# Install postgres 9.3
sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3
# Having Postgres 9.1 already, this will create database instance configured to run on port 5433
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install git build-essential git-core curl libssl-dev \
libreadline-gplv2-dev \
zlib1g zlib1g-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
libxslt-dev libxml2-dev
@michel
michel / hashtable.rb
Created July 15, 2013 21:15
TDD hashtable
require 'rspec'
#http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
class String
def hashKey
rot_hash
end
@michel
michel / gist:2642915
Created May 9, 2012 08:18
Pow not loading rvm env solution
rvm env . > .powenv
touch tmp/restart.txt
@michel
michel / walrus.rb
Created May 8, 2012 21:43
grow a test suite
class Walrus
attr_reader :energy
def initialize
@energy = 0
end
def receive_gift!(gift)
if gift.edible?
@energy += gift.digest.energy
@michel
michel / gist:2169470
Created March 23, 2012 10:39
LRUCache code kata 2
class LRUCache
def initialize(size = 10)
@size = size
@store = {}
@lru = []
end
def set(key, value)
@store[key] = value
@michel
michel / gist:2169353
Created March 23, 2012 10:26
Quick vim regex to convert hashrocket (=>) 1.8 to colon syntax (:) 1.9:
nmap <leader>rh :%s/\v:(\w+) \=\>/\1:/g<cr>