Skip to content

Instantly share code, notes, and snippets.

View devyn's full-sized avatar
👨‍💻
Nushell is really cool

Devyn Cairns devyn

👨‍💻
Nushell is really cool
View GitHub Profile
@devyn
devyn / oftn-bot-sol.js
Created August 4, 2011 20:39
!sol command for oftn-bot
function Flags(text) {
var m = text.match(/^-([^ ]+)( (.+))?/);
if (m) {
var s = m[1].split("");
return {all: s, flags: s.reduce(function(o,i) { o[i] = true; return o; }, {}), args: m[2] ? m[3] : undefined};
} else {
return null;
}
}
this.queue = {};
this.register_command("queue", function(context, text) {
var who = context.intent.name;
if (!this.queue[who]) this.queue[who] = [];
this.queue[who].push([context.sender, text]);
});
this.register_command("dequeue", function(context, text) {
var who = context.intent.name;
if (!this.queue[who]) this.queue[who] = [];
var item = (text == "peek") ? this.queue[who][0] : this.queue[who].shift();
goombaAt: [start_left, start_top]
image := load: "goomba.png"
draw := drawSprite: image at: [left, top]
left, top := walkOn: owner startingAt: [start_left, start_top]
game: arguments
<= world: arguments
goomba => goombaAt: [400, 300]
floor => rectObject: [400, 350, 800, 400] colored: {red: 100}
@devyn
devyn / #
Created August 28, 2009 21:58 — forked from rmanalan/gist:161461
script/generate plugin HelloWorld
# vendor/plugins/hello_world/init.rb
Rails.configuration.gem "sinatra"
Rails.configuration.middleware.insert_before("ActionController::Failsafe", "HelloWorld")
# vendor/plugins/hello_world/lib/hello_world.rb
# your sinatra app goes here...
require 'sinatra/base'
class HelloWorld < Sinatra::Base
@devyn
devyn / foo.rb
Created November 2, 2008 03:22 — forked from febuiles/foo.rb
# fast way to include too many stylesheets
def include_stylesheets
sheets = %w(dropdown style calendar/red/style facebox)
sheets.collect{|sheet|stylesheet_link_tag(sheet)}.join
end