Skip to content

Instantly share code, notes, and snippets.

View steve9001's full-sized avatar

Steve Masterman steve9001

View GitHub Profile
@steve9001
steve9001 / prng.js
Created May 7, 2019 17:34 — forked from blixt/prng.js
A very simple, seedable JavaScript PRNG.
/**
* Creates a pseudo-random value generator. The seed must be an integer.
*
* Uses an optimized version of the Park-Miller PRNG.
* http://www.firstpr.com.au/dsp/rand31/
*/
function Random(seed) {
this._seed = seed % 2147483647;
if (this._seed <= 0) this._seed += 2147483646;
}

Keybase proof

I hereby claim:

  • I am steve9001 on github.
  • I am steve9 (https://keybase.io/steve9) on keybase.
  • I have a public key ASCJ_yDjjJIrZZlw24lUs5EzTLcck8paPeHQGHvcSkdu6Qo

To claim this, I am signing this object:

date sell_type sell_quantity buy_type buy_quantity
Mar 28, 2018 5:09:04 AM USD 500 BTC 0.06197515
Mar 29, 2018 4:59:23 PM USD 800 BTC 0.11595698
Apr 21, 2018 2:14:32 AM BTC 0.05 USD 444.66
May 05, 2018 8:15:17 AM BTC 0.05 USD 494.18
say -v princess 'lalalalalala' &
say -v 'Agnes' lalalalala &
say -v 'Albert' lalalalala &
say -v 'Alex' lalalalala &
say -v 'Bad News' lalalalala &
say -v 'Bahh' lalalalala &
say -v 'Bells' lalalalala &
say -v 'Boing' lalalalala &
say -v 'Bruce' lalalalala &
say -v 'Bubbles' lalalalala &
# supersub text_to_replace replacement_text directory
function supersub {
ack -l "$1" "$3" | xargs perl -p -i -e "s/$1/$2/g"
}
@steve9001
steve9001 / patch.rb
Created August 13, 2013 17:17
Exception#pretty
class Exception
def pretty
%|\n#{self.class} (#{self.message}):\n #{backtrace.join("\n ")}\ n|
rescue Exception => e
"error in Exception#pretty: #{e}"
end
end
@steve9001
steve9001 / setup.sh
Created December 28, 2012 16:44 — forked from bkaney/setup.sh
#!/usr/bin/env zsh
# Install the following first:
#
# - chrome
# - iterm2
# - connect.apple.com command-line: XCode tools
successfully() {
class Exception
def pretty
trace = backtrace.select{ |l|l.start_with?(Rails.root.to_s) }.join("\n ")
"#{self.class}\n#{message}\n#{trace}\n"
end
end
@steve9001
steve9001 / balanced_payments_guest_checkout.md
Created May 22, 2012 15:18
Balanced Payments guest checkout workflow

Workflow for (repeat) guest checkout

  1. In your form, gather email address, credit card, and amount

  2. With balanced.js post the card data to Marketplace cards_uri

  • response is unique card token URI
  • response is never 409 Conflict ; passing the same card will always create a new token
  1. In js callback, post the email address, card token and amount to your server
@steve9001
steve9001 / foo.rake
Created April 27, 2012 14:46
db:test:prepare weirdness
desc "db:test:prepare makes the connected db different from the one implied by Rails.env"
task :foo => :environment do
puts Rails.env #development
puts User.count #1
Rake::Task["db:test:prepare"].invoke
puts Rails.env #??
puts User.count #??
end