Skip to content

Instantly share code, notes, and snippets.

View sandersch's full-sized avatar

Charlie Sanders sandersch

View GitHub Profile
item_for_spell = {
1611 => "lightning bolt-shaped blued steel rod",
613 => "long wooden stake",
913 => "small polychromatic trinket",
1204 => "petrified thanot wand",
1208 => "petrified thanot wand",
1220 => "petrified thanot wand",
}
get_xday_from_magicsack = proc do
require 'ostruct'
class Bounty
class Parser
@@task_assignment_regexs = {
/It appears they have a creature problem they'd like you to solve/ => :cull,
/It appears they need your help in tracking down some kind of lost heirloom/ => :heirloom,
/The local furrier .+ has an order to fill and wants our help/ => :skins,
/The local gem dealer, [^,]+, has an order to fill and wants our help/ => :gem,
# /to provide a protective escort/ => :escort,
load 'bounty_parser.lic'
class Bounty
describe Parser, "#parse" do
it "can tell when we don't have a task" do
bounty = described_class.parse "You are not currently assigned a task."
bounty[:task].should == :taskmaster
bounty[:requirements].should be_nil
bounty[:status].should be_nil
end
@sandersch
sandersch / rolaren.txt
Created August 31, 2017 17:58
rolaren horde
On an armor stand:
1 a rolaren augmented breastplate
2 some rolaren brigandine armor
3 a polished rolaren aegis
4 a rolaren greathelm
5 a rolaren chain hauberk
6 an ornate rolaren helm
On a weapon rack:
7 a gold-tipped rolaren broadsword
require 'ostruct'
class Bounty
class Parser
@@task_assignment_regexs = {
/It appears they have a creature problem they'd like you to solve/ => :cull,
/It appears they need your help in tracking down some kind of lost heirloom/ => :heirloom,
/The local furrier .+ has an order to fill and wants our help/ => :skins,
/The local gem dealer, [^,]+, has an order to fill and wants our help/ => :gem,
# /to provide a protective escort/ => :escort,
require 'ostruct'
def variable
["running_in_spec"]
end
def echo(*args)
puts *args if debug
end
> http GET garage/doors
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 63
Content-Type: application/json
Date: Sat, 02 May 2015 16:53:47 GMT
Server: WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
X-Content-Type-Options: nosniff
{
@sandersch
sandersch / clone_lvm_part.sh
Last active May 18, 2022 16:30
Back up an lvm partition using Clonezilla
# Mount image desintion to /home/partimag as desired
# No wizards from here. Use the Clonezilla command line
# Abort script on any failures, print out commands for debugging
set -e
set -x
# Partition to clone
[ -n "$VG_NAME" ] || VG_NAME="systemvg"
[ -n "$LV_NAME" ] || LV_NAME="rootlv"
~/tmp/rc cat c.rb
#!/usr/bin/ruby
puts 4
-5
~/tmp/rc ./c.rb
4
@sandersch
sandersch / bunny.rb
Last active December 19, 2015 02:09
Bunny gem for AMQP Spike
require "bunny"
# Start a communication session with RabbitMQ
conn = Bunny.new
conn.start
# open a channel
ch = conn.create_channel
# declare a queue