Skip to content

Instantly share code, notes, and snippets.

@ajacksified
ajacksified / breakup.lua
Created August 19, 2014 21:03
breakup.lua
--[[ old style ]]
-- init.lua
env.mj = { }
env.mj.doThing = function(sp)
print("did " .. op .. "on env" .. env.name)
end
.
|~~
|~~
/L\
,.---./LLL\. _.--.
.'(|~~`/LLLLL\` ) )`.,
.(` |~~/LLLLLLL\ ) )-. .
( ( /L\/LLLLLLLLL\ ) ) `|~~
/b_,dM\__,_
_/MMMMMMMMMMMm, -----
_YMMMMMMMMMMMM( ( I'm )
`MMMMMM/ / \ ( a )
MMM| __ / __/ ( wot )
YMM/_/# \__/# \ / -----
(. \__/ \__/
) _, |
_____/\ _ /
\ `._____,'
@ajacksified
ajacksified / days_since.coffee
Created January 18, 2012 23:59 — forked from zenhob/days_since.coffee
hubot script for tracking days since an event
# Generates commands to track days since an event
#
# it's been <number> days since <event> - Set the day when the event happened
# <event> on <date> - Set the date the event happened (yyyy-mm-dd)
# how long since <event>? - Display the number of days since the event
# when was/is/did <event>?
module.exports = (robot) ->
robot.respond /(.*?) on ((19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01]))$/, (msg) ->
event = msg.match[1]
@ajacksified
ajacksified / after.coffee
Created April 27, 2012 00:44
Why Coffeescript's 'extend' is beautiful with Backbone
App.Views.About ||= {}
class App.Views.About.BaseView extends App.Views.Base.BaseView
initialize: () ->
if @model
@model.bind('reset', @render)
@render()
render: =>
@ajacksified
ajacksified / formserialization.coffee
Created May 17, 2012 19:41
Coffeescript / Underscore form serialization
serializeForm: ($el) ->
return _.reduce($el.serializeArray(), (memo, v) ->
if v.name.match(/\[\]/)
v.name = v.name.replace(/\[\]/,'')
memo[v.name] ?= []
memo[v.name].push(v.value)
else
memo[v.name] = v.value
memo
, {});
@ajacksified
ajacksified / travis.coffee
Created September 6, 2012 21:56
travis hubot hook
# Description:
# "Travis CI alert hook"
#
# Configuration:
# None
#
# Commands:
# POST /hubot/travis [data]
#
# Authors:
class ScoreKeeper
constructor: (@robot) ->
@cache = { scoreLog: {}, scores: {} }
@robot.brain.on 'loaded', =>
@robot.brain.data.scoreLog ||= {}
@robot.brain.data.scores ||= {}
@cache.scores = @robot.brain.data.scores || {}
@cache.scoreLog = @robot.brain.data.scoreLog || {}
@ajacksified
ajacksified / yelpme.coffee
Created September 12, 2012 19:03
lunch capabilities for hubot
# Description
# Searches Yelp API to find you things.
#
# Dependencies:
# "yelp": "0.1.1"
#
# Configuration:
# HUBOT_YELP_CONSUMER_KEY=key
# HUBOT_YELP_CONSUMER_SECRET=secret
# HUBOT_YELP_TOKEN=token
@ajacksified
ajacksified / yelpme.coffee
Created September 20, 2012 22:56
hubot yelp me
# Description
# Searches Yelp API to find you things.
#
# Dependencies:
# "yelp": "0.1.1"
#
# Configuration:
# HUBOT_YELP_CONSUMER_KEY=key
# HUBOT_YELP_CONSUMER_SECRET=secret
# HUBOT_YELP_TOKEN=token