Skip to content

Instantly share code, notes, and snippets.

@chaffeqa
chaffeqa / 0_reuse_code.js
Created April 8, 2016 15:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/bin/sh
# hosts-to-vm.sh
# Drew Reece - September 2011
#
# Made for use alongside the excellent ievms - https://github.com/xdissent/ievms
#
# Will export the local hosts (from /etc/hosts)
# to a batch file & add that batch file to a Windows VM
# The batch script will be executed to import the hosts onto the VM
#
require 'rubygems'
require 'benchmark/ips'
class ExampleClass
def foo; 42; end
end
module ExampleMixin
def foo; 43; end
end
@chaffeqa
chaffeqa / check.rb
Created September 8, 2012 20:24
Griff's eyes only
class Check
initialize()
# do stuff
return "completed"
end
def completed?
...
end
end
@chaffeqa
chaffeqa / benchmark_bundle.rb
Created May 10, 2012 21:03 — forked from bdurand/benchmark_bundle.rb
Benchmark Your Bundle
#!/usr/bin/env ruby
require 'bundler'
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
# inspiration
# http://github.com/jnstq/rails-nginx-passenger-ubuntu
# sudo this sudo that bollocks
sudo -i
# system-related stuff
apt-get install htop strace sysstat
dpkg-reconfigure sysstat
apt-get install ntp