Skip to content

Instantly share code, notes, and snippets.

@cabron
cabron / masseffect.user.js
Last active December 11, 2015 20:29
ME3 Manifest Percentages and Character Builds
// ==UserScript==
// @name ME3 Manifest Percentages
// @namespace frostwyrm
// @include http://social.bioware.com/n7hq/home/inventory/?name=*&platform=*
// @include http://social.bioware.com/n7hq/home/characters/?name=*&platform=*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js
// ==/UserScript==
var percentageize = function (type) {
var denom = 0;
@cabron
cabron / rpn.rb
Created July 9, 2012 15:42
/r/dailyprogrammer #73 intermediate
#!/usr/bin/env ruby
class RPNError < ArgumentError
def initialize sym, stack
args = stack.reverse.map.with_index {|el, i|
"#{el}.#{sym} (#{i} for #{el.method(sym).arity})"
}.join(', ')
super "wrong number of arguments: #{args}"
end
end
@cabron
cabron / xtea.rb
Created November 12, 2011 20:41
Simple implementation of XTEA in Ruby 1.8.7
class XTEA
attr_reader :key, :key_o
MASK = 0xFFFFFFFF
DELTA = 0x9E3779B9
def initialize(key=rand(2**128), n=32)
@key_o = key
@n = n