Skip to content

Instantly share code, notes, and snippets.

module.exports = (robot) ->
robot.hear /^(exit|quit|leave|part)$/i, (msg) ->
msg.reply("Try /exit")
robot.hear /^(ls|rm|cat|cd|sudo)/, (msg) ->
msg.reply("Pardon me, but this is a chat room... not a shell")
@jazzychad
jazzychad / ZZZTypewriterLabel.h
Last active August 29, 2015 14:20
ZZZTypewriterLabel
//
// ZZZTypewriterLabel.h
//
// Created by Chad Etzel on 4/30/15.
// Copyright (c) 2015 Chad Etzel, MIT License.
//
//
// The MIT License (MIT)
//
// Copyright (c) 2015 Chad Etzel
struct EmailAddress {
let address : String
let domain : String
init(address : String, domain : String) {
self.address = address.lowercaseString
self.domain = domain.lowercaseString
}
}
// why does this not compile?
// Book implements BookRenderable
// so why does the compiler complain when Library.books is a [Book] and LibraryRenderable is looking for [BookRenderable] ??
protocol LibraryRenderable {
var address : String? { get }
var books : [BookRenderable]? { get }
}
protocol BookRenderable {
*** simplechat_orig.js 2009-12-10 17:20:47.000000000 -0500
--- chatevents.js 2009-12-10 17:20:26.000000000 -0500
***************
*** 1,6 ****
--- 1,8 ----
var tcp = require("tcp");
var sys = require("sys");
+ var chatEmitter = new process.EventEmitter();
+
var tcp = require("tcp");
var sys = require("sys");
var chatEmitter = new process.EventEmitter();
Array.prototype.remove = function(e) {
for(var i = 0; i < this.length; i++)
if(e == this[i]) this.splice(i, 1);
}
diff --git a/http-state.js b/http-state.js
index 476cc4a..71755d6 100644
--- a/http-state.js
+++ b/http-state.js
@@ -20,7 +20,7 @@ var idgen = require('./idgen');
res.set_cookie("session_id", session_id);
}
sessions[session_id] = (sessions[session_id] || {
- session: {},
+ session: {session_id:session_id},
#bash function to retrieve the last 5 tweets from a user
#based on the Chirp hackathon project by @jf and @jazzychad
#hattip @gypak
last5tweets ()
{
dig +short TXT `dig +short TXT $1.timeline.twitter.viadns.org | tr -d \"` | tr -d \"
}
#usage:
curl -vvv -ujazzychad -d"status=testing%20annotations%20again&annotations=[{\"typefoo\":{\"keyfoo\":\"valfoo\"}}]" http://api.twitter.com/1/statuses/update.xml
@jazzychad
jazzychad / metadata.json
Last active September 23, 2015 05:29
First Post: Jules Verne
{
"title": "First Post: Jules Verne",
"visbility": "public",
"visibility": "public"
}