This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Arguments < Hash | |
| def initialize (input) | |
| if input.is_a? String | |
| p input | |
| @quote = false | |
| @escape = false | |
| @buffer = '' | |
| @key = '' | |
| input.each_char do |char| |