Skip to content

Instantly share code, notes, and snippets.

View raws's full-sized avatar
🥯
dabbling in pumpernickel

Ross Paffett raws

🥯
dabbling in pumpernickel
View GitHub Profile
@raws
raws / wonder-llama-demo.rb
Last active June 9, 2021 04:04
Quick demo of responding to bot mentions using Wonder Llama: https://github.com/raws/wonder-llama
require 'bundler/inline'
gemfile do
gem 'wonder-llama', github: 'raws/wonder-llama', branch: 'master', require: 'wonder_llama'
end
def bot_mentioned?(message)
message.content.include?('@**Ralph**')
end
@raws
raws / gist:07002f33ff6cd2e0b6c638dc627ad3e5
Created November 26, 2018 21:23
Ruby array block argument splatting
[['foo', 'bar', 'baz']].each { |array| puts array.inspect }
#=> ["foo", "bar", "baz"]
[['foo', 'bar', 'baz']].each do |first, second, third|
puts first.inspect
puts second.inspect
puts third.inspect
end
#=> "foo"
#=> "bar"
@raws
raws / pumpkin_collection.rb
Created February 21, 2018 01:45
Demonstration of how to create an #each method on our own class that behaves similarly to Array#each
class PumpkinCollection
def initialize(colors)
@colors = colors
end
def each
i = 0
while i < @colors.length do
color = @colors[i]
@raws
raws / puma.rb
Created January 18, 2018 18:19
Puma config snippet
workers Integer(ENV.fetch('WEB_CONCURRENCY', '2')) / 2
threads_count = ENV.fetch('RAILS_MAX_THREADS', '2')
threads threads_count, threads_count
preload_app!
@raws
raws / chopt.rb
Last active November 12, 2016 22:52 — forked from prokop75/gist:a1e141c10b828d03ae74aca3f06e06e4
Chopt make order ahead orders not reorderable
chopt_location_ids = [5652, 6397, 6646, 6647, 6648, 6650, 6651, 6652, 6653,
6654, 7169, 7170, 7453, 7454, 7624, 7625, 7626, 7627, 7628, 7629, 7630,
7631, 7632, 7633, 8015, 8482, 10153, 10619, 10620, 10823, 10824, 11457,
11560, 14504, 14505, 14820, 15323, 17342, 22070, 22074, 22100, 22101]
orders = Order.completed.where(location_id: chopt_location_ids,
reorderable: true)
# Iterate through all orders, mark as reorderable = false, print IDs
orders.find_each do |order|
TJ's
----
0.25 lb tempeh
5.5 lb trail mix
0.25 lb chocolate-covered coffee beans
1.5 lb dehydrated veggies
0.5 lb jerky
Safeway
-------
> Treasure Island Warehouse Closing Sale and Burner Swap Meet
> Say hello to a good buy!
>
> What: Treasure Island Warehouse Sale and Burner Swap Meet
> When: Saturday May 28th & Sunday 29th from 10am - 4pm
> Where: East side of Building 180 (behind the “Winery”) - see link https://goo.gl/maps/T63wuv2kNQu
>
> Building 180 on Treasure Island has been home to some of Burning Man’s most inspiring Art Cars, sculptures, and imaginative creations over the last decade.
>
> Following our epic farewell party two weeks ago, we are hosting a sale and swap meet with a whole range of equipment and materials to make your next art, video, music, sculpture, or decor project complete.
@raws
raws / rpg.mediawiki
Last active April 6, 2016 08:14
Blolol RPG guide

Note: Check out https://github.com/blolol/rpg/wiki for up-to-date documentation!

Blolol RPG is a roleplaying game for lazy people. It's part of Wheaties, and takes place entirely in IRC. It's inspired by Idle RPG, which has been around since 2004. Idle RPG's own description sums up the game quite nicely:

The Idle RPG is just what it sounds like: an RPG in which the players idle. In addition to merely gaining levels, players can find items and battle other players. However, this is all done for you; you just idle. There are no set classes; you can name your character anything you like, and have its class be anything you like, as well.

Blolol RPG shares these core concepts with Idle RPG, but it also differs in some interesting ways. Read on to find out how to play!

Where to play

if roll?(0.25)
aliceleave_line
end

Keybase proof

I hereby claim:

  • I am raws on github.
  • I am raws (https://keybase.io/raws) on keybase.
  • I have a public key whose fingerprint is 4ABE CA14 6DA0 809F 2A80 EAB9 1E0A 2E61 486B DB1F

To claim this, I am signing this object: