Skip to content

Instantly share code, notes, and snippets.

View FluffyPira's full-sized avatar

Elizabeth Shewdyk FluffyPira

View GitHub Profile
@FluffyPira
FluffyPira / 5e.rb
Last active August 29, 2015 14:08
#!/usr/bin/env ruby
def roll_once
4.times.map { rand(1..6) }.sort.drop(1).reduce(:+)
end
def roll(rolls=1)
rolls.times.map { roll_once }
end
#!/usr/bin/env ruby
require 'twitter_ebooks'
include Ebooks
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
OATH_TOKEN = "" # oauth token for ebooks account
OAUTH_TOKEN_SECRET = "" # oauth secret for ebooks account
TWITTER_USERNAME = "PornyPira_Bot" # Ebooks account username
Some notes to the character sheet!
Initiative: Dex Bonus (4)
Attack Bonus (for weapons): Inspiration + Dex bonus (6)
Damage Bonus (for weaspons): Dex bonus (4)
Encumberance (weight limit before you lose 5m speed): 30lbs
Total Weight (currently): 50 lbs
SO!
#!/usr/bin/env ruby
require 'twitter_ebooks'
require 'set'
include Ebooks
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
OATH_TOKEN = "" # oauth token for ebooks account
OAUTH_TOKEN_SECRET = "" # oauth secret for ebooks account
#!/usr/bin/env ruby
require 'twitter_ebooks'
include Ebooks
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
OATH_TOKEN = "" # oauth token for ebooks account
OAUTH_TOKEN_SECRET = "" # oauth secret for ebooks account
ROBOT_ID = "book" # Avoid infinite reply chains
## pulling a specific line
if tweet.text.start_with?('Q')
q_reply = File.readlines("file.txt")
reply(tweet, q_reply[0])
else
reply(tweet, model.make_response(meta(tweet).mentionless, meta(tweet).limit))
end
## pulling a random line
require 'sinatra'
set :public_folder,File.dirname(__FILE__) + '/public'
run Sinatra::Application
get '/' do
send_file 'public/index.html'
end
.
├── Gemfile
├── Gemfile.lock
├── Procfile
├── README.md
├── composer.json
├── config.ru
└── public
├── articles.html
├── bootstrap
#####
#
# PyGlow
#
#####
#
# Python module to control Pimoronis PiGlow
# [http://shop.pimoroni.com/products/piglow]
#
# * based on cpu percentage utilisation indicator by Jason (@Boeeerb)
#include <Adafruit_NeoPixel.h>
#define PIN 0
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(32, PIN);
// Change These Variables
int maxBrightness = 70;
int minBrightness = 0;
int fadeSpeed = 25;