Skip to content

Instantly share code, notes, and snippets.

View irisfofs's full-sized avatar

Iris irisfofs

View GitHub Profile
@irisfofs
irisfofs / tree output.txt
Created January 24, 2016 01:00
The generated site scaffold for a new Jekyll::RpLogs site
.
├── arcs.html
├── _config.yml
├── _config.yml.default
├── css/
│   └── main.scss*
├── Gemfile
├── Gemfile.lock
├── _includes/
│   ├── footer.html
@irisfofs
irisfofs / _rp.scss
Created January 18, 2016 05:14
WIP inset box shadow for OOC lines
#log p.ooc {
background: #222;
padding: .5em;
margin-left: -1em;
margin-right: -1em;
box-shadow: inset 0em 0em 4px 0px #000;
}
#log p.ooc + p.ooc {
margin-top: -2.5em;
@irisfofs
irisfofs / solver.rb
Last active December 6, 2015 20:37
Advent of Code day 3 parts 1 and 2
class HouseLocation
DIRS = "^>v<"
attr_accessor :x, :y
def initialize(x = 0, y = 0)
@x = x
@y = y
end
@irisfofs
irisfofs / example.json
Created September 20, 2015 19:50
Sample badge JSON for the autoloader
{
"badgeTypeString": "Press Badge",
"badgePaymentType": "Comp",
"badges": [["Firstname Lastname","Badge name","[email protected]"],["Joe Smith","Joe","[email protected]"]]
}
@irisfofs
irisfofs / mappings.json
Last active February 6, 2016 19:04
Script to run through a media library (in iTunes XML format) and combine duplicates (add play counts together).
{
"mappings": {
"file://localhost/X:\\music\\CLOVER STUDIO - 大神 オリジナル・サウンドトラック [Disc 1]": "file://localhost/X:\\music\\Okami OST [Disc 1]",
"file://localhost/X:\\music\\CLOVER - Okami Original Soundtrack [Disc 2]": "file://localhost/X:\\music\\Okami OST [Disc 2]",
"file://localhost/X:\\music\\CLOVER STUDIO - Okami Original Soundtrack Disc 3": "file://localhost/X:\\music\\Okami OST [Disc 3]",
"file://localhost/X:\\music\\CLOVER STUDIO - Okami Original Soundtrack [Disc 4]": "file://localhost/X:\\music\\Okami OST [Disc 4]",
"file://localhost/X:\\music\\Masami Ueda [上田雅美] - Okami Original Soundtrack [大神]": "file://localhost/X:\\music\\Okami OST [Disc 5]"
}
}
@irisfofs
irisfofs / check_in.rb
Created August 31, 2015 19:18
Short script to compute histogram totals for check-in times.
require 'csv'
prereg = CSV.read("boomset_prereg_attendance_report_35918_08312015180554.csv")
at_door = CSV.read("boomset_at_door_attendance_report_35998_08312015180637.csv")
# puts prereg[0]
# Remove first row
prereg.shift
at_door.shift
@irisfofs
irisfofs / skype_to_raw.rb
Created August 22, 2015 02:56
Ruby script to convert lines from my IRC-Skype relay bot to be as though they were spoken in IRC.
require 'set'
TIMESTAMP = /^(?<timestamp>[-0-9 :]{19})/
BOT_NAME = /\tSkyBot\t/
SKYPE_MSG = /#{TIMESTAMP}#{BOT_NAME}<(?<nick>[^>]+)>(?<text>.*)$/
SKYPE_ACTION = /#{TIMESTAMP}#{BOT_NAME}\* (?<text>.*)$/
# NICK = /([\w\-\\\[\]\{\}\^\`\|]+)/
# Characters that can't be in a nick
NOT_NICK = /[^\w\-\\\[\]\{\}\^\`\|]/
@irisfofs
irisfofs / discount_codes.rb
Last active May 31, 2016 04:38
Ruby snippet to produce discount codes for use in say, Eventbrite.
require "set"
CHARS = []
("0".."9").each { |x| CHARS << x }
("A".."Z").each { |x| CHARS << x }
def create_code(prefix, length)
code = ""
length.times { code << random_character }
3535d6b HEAD@{0}: rebase -i (finish): returning to refs/heads/master
3535d6b HEAD@{1}: rebase -i (start): checkout HEAD~8
93aeaa2 HEAD@{2}: rebase: aborting
3535d6b HEAD@{3}: rebase -i (start): checkout HEAD~1
93aeaa2 HEAD@{4}: rebase: aborting
3535d6b HEAD@{5}: rebase -i (start): checkout HEAD~4
93aeaa2 HEAD@{6}: rebase: aborting
4784953 HEAD@{7}: rebase: More README updates
4c8ba22 HEAD@{8}: rebase: Update README with hopefully clearer instructions
331612c HEAD@{9}: rebase: checkout HEAD~4
@irisfofs
irisfofs / Gemfile
Created June 21, 2015 20:42
Sample Gemfile for Jekyll::RpLogs
source 'https://rubygems.org'
group :jekyll_plugins do
gem "jekyll-rp_logs"
end