Skip to content

Instantly share code, notes, and snippets.

# Run as: ruby auction_search.rb <item_id>
# Requires ruby 2.0 or higher, has no other dependencies.
# Will make its own temp file in the current directory for storing auction data,
# to make repeat queries faster. Delete the folder to force download fresh data.
# Sample output:
# Arthas ( high) |
# | 450000.0 horde-Auromus
require 'fileutils'
@jamie
jamie / gist:f2a528d77e70b7088956
Created September 3, 2014 16:51
If HTML tables were organized by column...
%table
%tc
%th Filename
- @batches.each do |batch|
%td= batch.filename
%tc
%th Result
- @batches.each do |batch|
%td= batch.summary
NB: My math is a bit off, fighter gets +4 to hit, +4 damage on swords
from Weapon Training, and from weapon mastery at lv20 he confirms all
crits, and the damage multiplier increases a step (to 3x in our case).
Also Greater Penetrating Strike will clear through 10 points of DR (of
which the Tarrasque has 15, also forgotten). To the mage's benefit,
Greater Spell Focus gives +2 DC, dropping the Tarrasque's saves by 10%.
Human Fighter, lv20
>> class Base
>> def self.foo
>> puts "foo!"
>> end
>> end
=> nil
>>
?> class Sub < Base
>> end
=> nil

Bastard (limited to human characters): One of your parents was a member of one of the great families of Brevoy, perhaps even of the line of Rogarvia itself. Yet you have no substantive proof of your nobility, and you’ve learned that claiming nobility without evidence makes you as good as a liar. While you might own a piece of jewelry, a scrap of once-rich fabric, or an aged confession of love, none of this directly supports your claim. Thus, you’ve lived your life in the shadow of nobility, knowing that you deserve the comforts and esteem of the elite, even though the contempt of fate brings you nothing but their scorn. Whether a recent attempt to prove your heritage has brought down the wrath of a noble family’s henchmen or you merely seek to prove the worth of the blood in your veins, you’ve joined an expedition into the Stolen Lands, hoping to make a name all your own. You take a –1 penalty on all Charisma-based skill checks made when dealing with members of Brevic nobility but gain a +1 trait bonus on Wil

module RailsLoggable
def rl_info(message)
rails_loggable_log(:info, message)
end
def rails_loggable_log(level, message)
Rails.logger.tagged(rails_loggable_tag) { Rails.logger.send(level, message) }
end
def rails_loggable_tag
@jamie
jamie / fibs.rb
Last active August 29, 2015 14:14
class Fib
def fib(n)
return n if n <= 1
fib(n-1) + fib(n-2)
end
end
class FibMemo
attr_accessor :fibs

I had just merged onto a high speed 3 lane road in Winnipeg that is normally busy, but except for a lone sporty Japanese car in the far left lane, was empty for a few blocks back. The motorcycle under me churned happily, now that I had the radiator facing into the wind again. I needed to turn left, and he was closing slowly, a comfortable distance back. 4 signal blinks, a shoulder check, and rolling on some throttle to even the closure rate, I move into the left lane. This apparently was a grave insult. Accelerating to close the distance quickly, the car came uncomfortably close behind me. The gleaming new car began an aggressive pass on the right.

So I said to myself, "what the fuck?" "Invalid query" self exclaims in return. He's a little literal sometimes. "Does he look a little aggressive to you?" "More than a little", self agrees.

50 meters ahead, the car slams on the brakes with a squawk of the tires, and ends up behind me. Repeating his performance, he passes me with as much acceleration as he had to

Hello everyone,

I would like to address the current situation regarding Arissa, and Art of the Catch, an animated fishing mod scripted by myself and animated by Aqqh.

It now lives in modding history as the first paid mod to be removed due to a copyright dispute. Recent articles on Kotaku and Destructiod have positioned me as a content thief. Of course, the truth is more complex than that.

I will now reveal some information about some internal discussions that have occurred at Valve in the month leading up to this announcement, more than you've heard anywhere else.

I'll start with the human factor. Imagine you wake up one morning, and sitting in your inbox is an email directly from Valve, with a Bethesda staff member cc'd. And they want YOU, yes, you, to participate in a new and exciting program. Well, shit. What am I supposed to say? These kinds of opportunities happen once in a lifetime. It was a very persuasive and attractive situation.

@jamie
jamie / EvenOdd.lua
Created June 18, 2015 19:50
Easy custom problem specification for bonus campaign
-- The function get_name() should return a single string that is the name of the puzzle.
--
function get_name()
return "EVEN / ODD"
end
-- The function get_description() should return an array of strings, where each string is
-- a line of description for the puzzle. The text you return from get_description() will
-- be automatically formatted and wrapped to fit inside the puzzle information box.
--