Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ajacksified on github.
  • I am ajacksified (https://keybase.io/ajacksified) on keybase.
  • I have a public key whose fingerprint is 5407 F376 63D5 1E24 8134 EB7D 8624 00BA CA1B D833

To claim this, I am signing this object:

@ajacksified
ajacksified / converse.coffee
Created May 3, 2013 17:20
converse.coffee for hubot
# Allows Hubot to talk back. Passive script.
cleverbot = require('cleverbot-node')
class Messages
constructor: (@robot) ->
@cache = []
@robot.brain.on 'loaded', =>
if @robot.brain.data?.messages
@cache = @robot.brain.data.messages
@ajacksified
ajacksified / brent-beerify.html
Created October 5, 2012 23:23
drag and drop thing
<!DOCTYPE html>
<html>
<head>
<title>Drag and Drop Example</title>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/ui-lightness/jquery-ui.css" rel="stylesheet" />
<style>
#container {
height: 400px;
width: 700px;
@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
@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
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 / travis.coffee
Created September 6, 2012 21:56
travis hubot hook
# Description:
# "Travis CI alert hook"
#
# Configuration:
# None
#
# Commands:
# POST /hubot/travis [data]
#
# Authors:
@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 / 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 / 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]