Skip to content

Instantly share code, notes, and snippets.

View irisfofs's full-sized avatar

Iris irisfofs

View GitHub Profile
@irisfofs
irisfofs / gui-completion.c
Created February 20, 2015 05:15
currently broken attempt to allow tab-completion after arbitrary prefixes
if (size > 0)
{
i = pos;
pos_start = i;
ignore_prefix_chars = !CONFIG_STRING(config_completion_ignore_prefix_chars)
&& !CONFIG_STRING(config_completion_ignore_prefix_chars)[0];
/* only backtrack on a space, other characters would be unexpected */
if (data[i] == ' ') // Guards against a double space?
{
if ((i > 0) && (data[i-1] != ' ') && (ignore_prefix_chars
#MaxThreadsPerHotkey 1
#MaxHotkeysPerInterval 10000000000000
#Singleinstance FORCE
`::
Sleep 50
send {9 Down}
sleep 25
send {9 Up}
Sleep 50
@irisfofs
irisfofs / pisg_smileys.patch
Created March 10, 2015 01:01
A patch for pisg to improve its smiley parsing with a lot more smileys.
From aa0d9705564580ad6059e9e9e793a25764dd3a9f Mon Sep 17 00:00:00 2001
From: Andrew <[email protected]>
Date: Mon, 9 Mar 2015 20:53:59 -0400
Subject: [PATCH] Updated smiley parsing code
---
pisg/modules/Pisg/Parser/Logfile.pm | 51 ++++++++++++++++++++++++++++++-----
1 file changed, 44 insertions(+), 7 deletions(-)
diff --git a/pisg/modules/Pisg/Parser/Logfile.pm b/pisg/modules/Pisg/Parser/Logfile.pm
@irisfofs
irisfofs / parse_der.rb
Created June 13, 2015 02:22
Junk parser
MODE = /([+%@&~!]?)/
NICK = /([\w\-\\\[\]\{\}\^\`\|]+)/
DATE_REGEXP = /(\d\d\d\d \d\d \d\d\[\d\d:\d\d\])/
# Crappy but worked for examples, could definitely be improved
USER_AT_HOST = /\(\w+@[^)]+\)/
JUNK = /#{DATE_REGEXP} \* #{MODE}#{NICK} (sets mode:|is now known as|(#{USER_AT_HOST} (has joined|Quit))).*$/
git remote add upstream https://github.com/xiagu/jekyll-rp-logs.git
git fetch upstream
git merge upstream/master
@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
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 / 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 }
@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 / 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