Skip to content

Instantly share code, notes, and snippets.

dgageot /
Last active May 28, 2019
PhantomJs / GhostDriver / FluentLenium with automatic install of PhantomJs
package com.fractales.synchro.helpers.phantomjs;
kesor / Gemfile
Last active Sep 30, 2019
Vagrantfile to create a chef-server (11.x) and a client box that uses it.
View Gemfile
source :rubygems
gem 'json', '= 1.5.4' # knife/chef 11.0 and 11.20 is broken with json 1.5.5/1.7.7
gem 'vagrant'
gem 'vagrant-hostmaster'
Hydrotoast /
Last active Dec 10, 2015
An pseudocode AI demonstrating the Minimax algorithm. Note that the algorithm has two helper functions: min and max.
class AdversarialSearchAI {
private PieceType piece;
public AdversarialSearchAI(PieceType piece) {
this.piece = piece;
* Returns the best move given the state of the game
fnichol /
Created Dec 20, 2012
Chef Metadata Chopper!


MetadataChopper.extract('metdata.rb') # => [ "rvm", "0.9.1" ]
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

jtimberman / gist:3088517
Last active Feb 7, 2018
Replace $VAGRANTBOX with box names that should be repackaged with updates. Don't specify it for up, ssh, and package if you're not using a multi-VM vagrantfile
View gist:3088517
% vagrant up --no-provision $VAGRANTBOX
% vagrant ssh $VAGRANTBOX
vagrant$ wget -O - | sudo bash
vagrant$ rm /tmp/chef*{rpm,deb}
vagrant$ exit
% vagrant package $VAGRANTBOX
% rm -rf ~/.vagrant.d/boxes/$VAGRANTBOX
% vagrant box add $VAGRANTBOX
sperlic /
Created May 13, 2012 — forked from whiteinge/
Example fabric script with VirtualBox automation
# -*- coding: utf-8 -*-
"""MyCompany Fabric script.
* Deploy code
* Set up a local development environment
There are two ways to deploy the myrepo code:
1. :func:`deploy` will do a full virtualenv installation/update and expand a
tarball of the specified git revision (defaults to HEAD) to a timestamped
krosenvold / gist:2508909
Created Apr 27, 2012
Try this on your multimodule maven build and watch the performance difference !
View gist:2508909
jtimberman / rename-node.rb
Created Mar 2, 2012 — forked from mpasternacki/rename-node.rb
A knife exec script to change Chef node's name.
View rename-node.rb
#!./bin/knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
# Usage: knife exec rename-node.rb old-name new-name
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
chowey / syntax.js
Created Feb 18, 2012
Jade Syntax Checker
View syntax.js
var jade = require('jade'),
runtime = require('jade/lib/runtime'),
spawn = require('child_process').spawn,
fs = require('fs');
function parse(str, filename){
var options = {filename: filename, compileDebug: true};
try {
// Parse
var parser = new jade.Parser(str, filename, options)