Skip to content

Instantly share code, notes, and snippets.

View btaitelb's full-sized avatar

Ben Taitelbaum btaitelb

View GitHub Profile
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (= 1.0.9)
Current Bundler version:
bundler (1.0.10)
Your version of Bundler is older than the one requested by the Gemfile.
Perhaps you need to update Bundler by running `gem install bundler`.
@btaitelb
btaitelb / gist:1181461
Created August 30, 2011 17:37
allows unnamed arguments for rake task to be retrieved
module Rake
class TaskArguments
def initialize(names, values, parent=nil)
@names = names
@parent = parent
@hash = {}
values.each_with_index { |val, i|
name = (names[i] || "param#{i}").to_sym
@hash[name] = val
}
@btaitelb
btaitelb / .bashrc
Created October 13, 2011 01:05
jenkins .bashrc w/ rvm
~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
if [[ -n "$PS1" ]] ; then
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@btaitelb
btaitelb / git-sed
Created December 3, 2011 00:59
git-sed
sed -e 's/search for/replace/g' -i .orig $(git grep --name-only 'search for' | xargs)
@btaitelb
btaitelb / gist:1630017
Created January 18, 2012 00:33
ab generating more requests than it says?
btaitelb@grew (master)% ab -n 1 -c 1 "http://127.0.0.1:5000/comments"
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient).....done
Server Software: thin
Server Hostname: 127.0.0.1
@btaitelb
btaitelb / checkValidity.html
Created January 18, 2012 21:07
QUnit Test for webshims checkValidity
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery Test Suite</title>
<link rel="stylesheet" href="qunit/qunit.css" media="screen">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
@btaitelb
btaitelb / strategies.rb
Created April 18, 2012 03:06
some old java code that happens to be in ruby
#
# strategies.rb
# reframeit-testing
#
# Created by Ben Taitelbaum on 2/25/08.
# Copyright (c) 2008 __MyCompanyName__. All rights reserved.
#
module ActiveThrift
class CompoundStrategy
#
# strategy_test.rb
# reframeit-testing
#
# Created by Ben Taitelbaum on 2/25/08.
# Copyright (c) 2008 __MyCompanyName__. All rights reserved.
#
require 'rubygems'
require 'test/unit'
@btaitelb
btaitelb / gist:2661015
Created May 11, 2012 17:04
ruby novice mistake
>> pants = true
=> true
>> shirt = false
=> false
>> dressed = pants and shirt
=> false
>> dressed
=> true
100110 01100110101 1011001
1010110010011 10110011010110010 100110101101
11001110010011101 100110100111010011010 011010110100101
10100110011001110011 110100101101001101001 1011011010110010 1011011
0110011100110001110010011001101001000110010110 101001101110101100 101101101110
0111001101100111101011010110110010011010010011011101011001000110 101101101110110
1001101011010110100110101101011010011100101101110101101001010100101001101
00100110101101011011101011010010010111101011100000101001101011101011010
1011011010011101001110010011101101101101101101010110100100100101001010011100101
00110010110100011010010110100100110100110111010110010010110011010110101101101