Skip to content

Instantly share code, notes, and snippets.

View btaitelb's full-sized avatar

Ben Taitelbaum btaitelb

View GitHub Profile

Keybase proof

I hereby claim:

  • I am btaitelb on github.
  • I am benji (https://keybase.io/benji) on keybase.
  • I have a public key whose fingerprint is 6C52 F9C2 5596 2CC1 F4C9 9A6B 3D03 B326 DAF1 D7E7

To claim this, I am signing this object:

@btaitelb
btaitelb / wp_domain_count.rb
Created May 7, 2014 19:20
How many recently visited domains used wordpress?
#!/usr/bin/env ruby
## Dependencies:
## * curl
## * jq (not really needed, but I like it)
## * sqlite
## * quit chrome before running this since the History file is locked
require 'uri'
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'