Skip to content

Instantly share code, notes, and snippets.

View NuckChorris's full-sized avatar

Peter Lejeck NuckChorris

View GitHub Profile
$(function(){
doItFgt($('#cocks'));
})
var degree = Math.PI / 180;
var doItFgt = function (el) {
var size = el.height()
var mid = size / 2
var ctx = el[0].getContext('2d')
require 'net/http'
require 'uri'
require 'wikicloth'
class Wikebooks < WikiCloth::Parser
def initialize (opts)
@root = URI.parse opts[:wiki]
@url = @root.clone
@url.query = "&action=raw&title=#{URI.encode opts[:article]}"
class Packet
attr_reader :cmd, :param, :args, :body, :sub, :depth, :raw
def initialize (pkt)
@args = {}
@sub = []
if pkt.is_a? Hash
@cmd = pkt[:cmd]
@param = pkt[:param]
@args = pkt[:args]
@body = pkt[:body]
var bot = require('./bot');
var compileSong = function (lines) {
var trigs = {};
var addTrig = function (time, line) {
if (!line.func && line.text) {
line.func = function () {
return line.text;
};
}
var SONGS = require('./songs');
var bot = require('./bot.js');
var singer = require('./singer.js');
bot.on('newsong', function (data) {
var song = data.room.metadata.current_song;
console.log(song);
});
var singer = require('./singer.js');
var ponDeFloor = singer.compileSong(require('./ponDeFloor.js'));
bot.on('newsong', function (data) {
var song = data.room.metadata.current_song;
// I forget how I detected songs, but once you've determined the song is Pon De Floor...
singer.sing(bot, ponDeFloor);
});
class Packet
attr :cmd, :param, :args, :body
def sub
unless @body.nil?
body.split("\n\n").map { |sub| Packet.new sub }
else
[]
end
end
def raw
class Packet
attr :cmd, :param, :args, :body
def sub
unless @body.nil?
body.split("\n\n").map { |sub| Packet.new sub }
else
[]
end
end
def raw
require_relative 'sold/module'
class System < Sold::Module
name 'System'
description 'Commands for managing the bot.'
help :restart, 'Restarts the bot.'
command :restart do |args|
respond 'Restarting...'
exit 1
class Arguments < Hash
def initialize (input)
if input.is_a? String
p input
@quote = false
@escape = false
@buffer = ''
@key = ''
input.each_char do |char|