Skip to content

Instantly share code, notes, and snippets.

View bencaron's full-sized avatar

Benoit Caron bencaron

  • Montreal, Quebec, Canada
View GitHub Profile

Keybase proof

I hereby claim:

  • I am bencaron on github.
  • I am bencaron (https://keybase.io/bencaron) on keybase.
  • I have a public key whose fingerprint is 09C0 CE5A 0B58 49F7 C4B8 E786 0E18 38ED B03A B67D

To claim this, I am signing this object:

#!/usr/bin/env ruby
#
# Extract URI from an Apache log and generate a
# full URL file (like for exemple load-testing with Siege)
#
# Usage:
# extract-url.rb your.domain.name.com logfile [logfile logfile logfile]
#
targetdomain = ARGV.shift
@bencaron
bencaron / Vagrantfile
Last active August 29, 2015 14:23 — forked from tvjames/Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@bencaron
bencaron / kitten.cron
Created October 24, 2014 13:55
Kittens, kittens!
* * * * * /usr/bin/curl http://placekitten.com/g/400/600 -o $HOME/kitten && /usr/bin/open $HOME/kitten
@bencaron
bencaron / pre-commit
Last active August 29, 2015 14:05
SASS -> CSS pre-commit hook
#!/bin/bash
# Watch for changes in the $SASS_DIR
# If anything change, compile the sass files to css
SASS_DIR="sass/"
STAGED=`git diff --cached --name-only`
echo $STAGED | if grep --quiet "$SASS_DIR"
then
@bencaron
bencaron / svndiffcmd.sh
Created August 21, 2012 15:04
SVN diff ignore space
#/bin/sh
# Merci FreeFallFred!
DIFF="/usr/bin/diff"
LEFT_LABEL="$3"
RIGHT_LABEL="$5"
LEFT="$6"
RIGHT="$7"
OUTPUT=`$DIFF $LEFT -L "$LEFT_LABEL" $RIGHT -L "$RIGHT_LABEL" -ubB`
#!/usr/bin/env ruby
def find_deps(cookbook_dir)
nel = Hash.new { |h, k| h[k] = [] }
Dir.glob("#{cookbook_dir}/*/").each do |r|
deps_for(r, nel)
end
nel
end
@bencaron
bencaron / Vagrantfile
Created September 12, 2011 01:55
Vagrant-couchdb
Vagrant::Config.run do |config|
config.vm.box = "lucid32"
config.vm.boot_mode = :gui
# Enable provisioning with chef solo, specifying a cookbooks path (relative
# to this Vagrantfile), and adding some recipes and/or roles.
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.add_recipe "couchdb"