Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# gem install xml-simple psych
require 'xmlsimple'
require 'psych'
require 'open-uri'
require 'fileutils'
require 'yaml'
require 'thread'

Keybase proof

I hereby claim:

  • I am joeyrobert on github.
  • I am joeyrobert (https://keybase.io/joeyrobert) on keybase.
  • I have a public key whose fingerprint is 8603 8B3C 3BE1 5587 1E31 42C7 5C54 64B0 A9E6 B2EE

To claim this, I am signing this object:

What's this PR do?

Where should the reviewer start?

How should this be manually tested?

Any background context you want to provide?

What are the relevant tickets?

Screenshots (if appropriate)

Definition of Done:

  • Is there appropriate test coverage? (e.g. ChefSpec, Mocha/Chai, Python, etc.)
  • Does this PR require a Selenium test? (e.g. Browser-specific bugs or complicated UI bugs)
  • Does this PR require a regression test? All fixes require a regression test.
@joeyrobert
joeyrobert / gist:6245784
Last active December 21, 2015 03:58 — forked from jayd3e/gist:6196323
Install instructions for a base Ubuntu box
On local machine:
sudo apt-get install python-dev python-pip python-setuptools ruby virtualbox build-essential nfs-common nfs-kernel-server
mkdir ~/Boxes
cd ~/Boxes
git clone git@github.com:clusterflunk/clusterstack.git
easy_install pip
pip install ansible
cp ~/.ssh/id_rsa.pub ~/Boxes/clusterstack/roles/common/files/.ssh/
cp ~/.ssh/id_rsa ~/Boxes/clusterstack/roles/common/files/.ssh/
@joeyrobert
joeyrobert / beautify.rb
Created June 7, 2012 14:55
beautify javascript directory
#!/usr/bin/env ruby
if ARGV[0]
Dir.glob(ARGV[0]+"**/*.js").each do |file|
puts "Beautifying JS file: #{file}"
puts `js-beautify -s 2 -j -o "#{file}.pretty" "#{file}"`
puts `mv "#{file}.pretty" #{file}`
end
else
puts "Usage: #{__FILE__} directory"
end
@joeyrobert
joeyrobert / lastfm_mediamonkey.rb
Created August 19, 2011 02:01
lastfm_mediamonkey.rb
require 'win32ole'
require 'net/http'
require 'rexml/document'
class FindSongs
def initialize(user, api_key)
@username = user
@api_key = api_key
@mediamonkey = WIN32OLE.new('SongsDB.SDBApplication')
end
@joeyrobert
joeyrobert / spam.rb
Created December 15, 2010 01:45
spam.rb
# spam.rb - Creates spam logfiles from an example. Rates are approximate.
if ARGV[2] !~ /^\d+$/ || !File.exists?(ARGV[0])
puts "USAGE: ruby #{__FILE__} [source] [dest.] [rate in mb/s]"
puts "i.e.: ruby #{__FILE__} example.log spam.log 3"
exit
end
trap("INT") { exit }
@joeyrobert
joeyrobert / benchmarking.md
Created October 14, 2010 22:47
info for system benchmarking

Benchmarking

CPU

wget http://www.tux.org/~mayer/linux/nbench-byte-2.2.2.tar.gz  
tar fxz nbench-byte-2.2.2.tar.gz  
cd nbench-byte-2.2.2  

make

require 'zlib'
class BloomFilter
def initialize(length = 100, hashes = 3, data = [])
@hashes = hashes
@length = length
@bits = Array.new(@length)
@inserted = 0
add(data)
# Blackjack
# Author: Joey Robert <joey@joeyrobert.org>
module Blackjack
class Player
attr_accessor :name, :money, :cards, :bets, :pushed
def initialize(name)
@name = name
@money = 1000