Skip to content

Instantly share code, notes, and snippets.

@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
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

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

>> class Base
>> def self.foo
>> puts "foo!"
>> end
>> end
=> nil
>>
?> class Sub < Base
>> end
=> nil
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
@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
# 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 / download.rb
Last active September 13, 2023 21:55
Downloads 1080p wallpapers for Steam cards, using http://www.steamcardexchange.net/index.php?showcase as an index
# INSTALLATION
# Requres ruby 1.9+, and the nokogiri gem (gem install nokogiri)
# Should work fine on Windows, Mac, Linux
# Also needs a working curl, so windows users might need to do some work there.
# USAGE
# Hit up the game you want to scrape from Steam Card Exchange, like so:
# http://www.steamcardexchange.net/index.php?gamepage-appid-440
# Then, referencing the app ID in the url, run this script:
# ruby download.rb <appid>
@jamie
jamie / gist:b88269dbcec98fe2c6f6
Last active August 29, 2015 14:02
Tales of Honor
Level 1: 0
Level 2: 7,000
Level 3: 18,000 IV.0
Level 4: 33,000 IV.1
Level 5: 52,000 ?
Level 6: 75,000 IV.3
Level 7: 102,000 IV.4
Level 8: 132,000 IV.4, IV.1
Level 9: 168,000 IV.4, IV.3
Level10: 207,000 IV.4, IV.4

The snow has begun to fall in King Landing, the Maesters have sent out the great white ravens. This long, bloody summer is at an end. A great man once said the "The Starks are always right eventually", and that rings more true than ever before.

A dead boy has landed upon the eastern shore and has proclaimed himself a king. Some may believe it is true, although they are fools. Black or red, the boy has done nothing and is nothing. Those who flock to him are doing it in hopes he can warm them once the cold winds reach south. He will proclaim Blood and Fire, and Blood will surely be shed in his name. But it is the Fire he lacks, and without that, the Blood will surely freeze.

Another boy who claims-to-be-King sits upon the Iron Throne. A bastard in truth, who cannot hope to survive the cold. In the summer warmth, a boy who smells of roses can be king, provided his gold is good. But in the Winter, roses wilt and die, and summer's gold cannot buy Winter's favor. The lion cub will surely perish in the cold, shive