Skip to content

Instantly share code, notes, and snippets.

View michel's full-sized avatar

Michel de Graaf michel

View GitHub Profile
# 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
#!/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
@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
@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 / Gemfile
Created February 17, 2010 20:46
Rails 2.3.5 and bundler
#Example gemfile
source :gemcutter
# Rails 2.3.5
gem 'rails', '~> 2.3.5', :require => nil
gem 'ruby-mysql', '>= 2.9.1', :require => 'mysql'
gem 'haml', '2.2.19', :require => nil
gem 'inherited_resources', '= 1.0.3'
@michel
michel / protheme.xccolortheme
Created March 1, 2010 18:54
Xcode pro theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Colors</key>
<dict>
<key>Background</key>
<string>0.097 0.101 0.124</string>
<key>InsertionPoint</key>
<string>1.000 1.000 1.000</string>
require 'socket'
require 'openssl'
require 'net/ftp'
class Net::FTPS < Net::FTP
end
class Net::FTPS::Implicit < Net::FTP
FTP_PORT = 990
@michel
michel / alpha_substr.rb
Created November 20, 2010 13:12
Alphabet in substring?
#!/usr/bin/env ruby -wKU
# Say you have one string of alphabetic characters, and say you have another,
# guaranteed smaller string of alphabetic characters. Algorithmically speaking,
# what's the fastest way to find out if all the characters in the smaller string are in the larger string?
#
# For example, if the two strings were:
#
#
# String 1: ABCDEFGHLMNOPQRS
@michel
michel / download_chromium.sh
Created March 17, 2011 10:34
Download and install latest Chromium build on OS X. For a quick install run the following command in your console: curl https://gist.github.com/raw/874137/2f045246310587f5384c9db57e62f049e89ffbc6/download_chromium.sh > download_chromium.sh; chmod +x down
#!/bin/bash
BASEDIR=http://build.chromium.org/f/chromium/snapshots/Mac
mkdir -p /tmp/chromium_nightly
cd /tmp/chromium_nightly
echo "Downloading number of latest revision"
REVNUM=`curl -# $BASEDIR/LATEST`
echo "Found latest revision number $REVNUM, starting download"
alias app_setup='br db:drop:all && br db:create:all && br dsi:schema:load && br db:schema:load && br db:seed'