Skip to content

Instantly share code, notes, and snippets.

View lusis's full-sized avatar

John E. Vincent lusis

View GitHub Profile
@mbbx6spp
mbbx6spp / erlang-shell-notes.erl
Created March 23, 2011 14:00
Notes on using Meck API (a mocking library in Erlang) which are not well documented
% Will create a fully mocked version of existing_module until caller crashes
meck:new(ExistingModule).
% Will create a fully mocked version of existing_module even after caller crashes
meck:new(ExistingModule, [nolink]).
% Will allow you to overload existing module, keeping old functions around
meck:new(ExistingModule, [passthrough]).
% Unload mocks and revert to real module implementation
@kennethreitz
kennethreitz / virtualenvs.zsh
Created March 28, 2011 15:23
Automatic de/activating virtualenvs!
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/share/python//virtualenvwrapper.sh
export VIRTUALENV_USE_DISTRIBUTE="1"
function cd(){
builtin cd "$@"
$(/Users/kreitz/.oh-my-zsh/tools/workon.py)
}
@jordansissel
jordansissel / package.sh
Created March 31, 2011 22:37
An attempt to copy the current rvm instance into a monolithic package.
#!/usr/bin/env bash
set -e
builddir="build/monolithic"
mkdir -p $builddir
# Copy gems
for path in $(echo "$GEM_PATH" | tr ":" " "); do
echo "Copying $path"
rsync -a "$GEM_HOME/" $builddir/gem

When I say "If your vcs doesn't encourage you to submit early and submit often, you need a new vcs" what do I mean?

The benefits of early and often commits aren't (or shouldn't be disputable). Frequent checkins of small changes reduce the chance of breakage to your code. It's not only easier to merge smaller changes but also easier to undo those changes.

As for VCSs that encourage it, I would typically consider git and hg to be on top of that ideal. Mind you this could apply to any DVCS simply due to the nature of having to support fully disconnected operation.

In the case of Git and Mercurial, they take into account the steps made to generate a new file. Subversion, on the otherhand, looks at two separate files and tries to suss out how to make them fit together.

If we're commiting early and commiting often (assuming we agreed by that premise), mercurial and git both have more information to work with when merging the files together and merging becomes painless. When merging becomes painless things like

@dalecaru
dalecaru / innobackupex-restore.sh
Created April 20, 2011 13:42
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# This script is provided as-is; no liability can be accepted for use.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"
@coderholic
coderholic / setup-statsd.sh
Created April 21, 2011 18:16 — forked from collegeman/setup-statsd.sh
Turn an Ubuntu 10.04 linode into a StatsD/Graphite server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# download the Node source, compile and install it
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
# install the Node package manager for later use
@macros
macros / 24 drive hardware raid6
Created April 22, 2011 10:37
48 drive x-25m tests
oot@file-s4:/mnt# tiobench --size 196608 --threads 1 --threads 4 --threads 16 --threads 64 --random 20000
Run #1: /usr/bin/tiotest -t 64 -f 3072 -r 312 -b 4096 -d . -T-TT
Unit information
================
File size = megabytes
Blk Size = bytes
Rate = megabytes per second
CPU% = percentage of CPU used during the test
Latency = milliseconds

Hi Kenneth,

We haven’t met before but I came across your _ profile/activity and really hope to connect. I am a headhunter in the SF Bay Area and several of my clients are looking for Ruby developers. Is there any chance you might be open to a new gig? It would be a full time position onsite here in the Bay Area (Mecca) and relo assistance is no problem if needed. I know this is a bit of out of the blue, but I thought I’d get creative this afternoon and see if I could make contact with someone on _. If you happen be pair programming and opened this email, both of you should know that I'll send you an ipad if your partner gets taken away from you. no joke.
I'm happy to share a few ideas if you're open to seeing what's out there. Feel free to give me a ring or send a note when you have a minute.

Cheers,

Recruiter

@jcartledge
jcartledge / ~_.config_terminator_config
Created April 27, 2011 04:31
terminator config solarized
[global_config]
title_transmit_bg_color = "#839496"
title_inactive_fg_color = "#93a1a1"
title_transmit_fg_color = "#eee8d5"
title_inactive_bg_color = "#586e75"
[keybindings]
[profiles]
[[default]]
palette = "#073642:#d30102:#859900:#b58900:#6c71c4:#d33682:#2aa198:#839496:#586e75:#cb4b16:#859900:#b58900:#268bd2:#d33682:#2aa198:#93a1a1"
login_shell = True
@skeptomai
skeptomai / http-twiddle.el
Created May 19, 2011 21:37
Sending signed requests to the Opscode Platform with Emacs and http-twiddle-mode
;;; http-twiddle.el -- send & twiddle & resend HTTP requests
;; This program belongs to the public domain.
;; Author: Luke Gorrie <luke@synap.se>
;; Maintainer: Hasan Veldstra <h@vidiowiki.com>
;; Created: 1 Feb 2006
;; Adapted-By: Hasan Veldstra
;; Adapted-By: Christopher Brown <cb@opscode.com>
;; Version: 1.0