Skip to content

Instantly share code, notes, and snippets.

#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
#!/bin/bash
scp ~/.ssh/id_rsa.pub $1:~
ssh $1 "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod -R 600 ~/.ssh/* && cat ~/id_rsa.pub >> ~/.ssh/authorized_keys && rm ~/id_rsa.pub"
httperf --hog --server 10.1.10.118 --port 8080 --num-conn 10000 --ra 100 --num-calls=100 --timeout .01
require 'rubygems'
require 'spec'
describe "iterative matchers" do
def all_be &block
simple_matcher "all be" do |given, matcher|
matcher.failure_message = "expected #{given.inspect} to all be something"
matcher.negative_failure_message = "expected #{given.inspect} to not all be something"
given.all? &block
end
@samg
samg / bdd.vim
Created November 16, 2009 06:15
function! BDD(args)
if bufname("%") =~ "test.rb"
call RunTest(a:args)
elseif bufname("%") =~ ".scala"
call RunSBTTest()
elseif bufname("%") =~ "spec.rb"
call RunSpec(a:args)
else
echo "don't know how to BDD this file"
end
# put this in your .bashrc or .profile
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
PS1='\w $(parse_git_branch) $ '
// ==UserScript==
// @name login
// @namespace http://fluidapp.com
// @description This keeps you logged in to new relic across browser sessions
// @include *
// @author Sam Goldstein
// ==/UserScript==
(function () {
if (window.fluid) {
#!/usr/bin/env ruby
#
# Git pre-commit hook:
# Install at .git/hooks/pre-commit and set as executable
#
# Interactively sets git commit author for pair programming
#
###################################################
# Configuration
" Execute open rspec buffer
" Thanks to Ian Smith-Heisters
function! RunSpec(args)
if exists("b:rails_root") && filereadable(b:rails_root . "/script/spec")
let spec = b:rails_root . "/script/spec"
else
let spec = "spec"
end
let cmd = ":! " . spec . " % -cfn " . a:args
execute cmd
# Use local mail server
config.action_mailer.delivery_method = :sendmail