This file contains 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
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") | |
This file contains 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
// | |
// 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 |
This file contains 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
struct EmailAddress { | |
let address : String | |
let domain : String | |
init(address : String, domain : String) { | |
self.address = address.lowercaseString | |
self.domain = domain.lowercaseString | |
} | |
} |
This file contains 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
// 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 { |
This file contains 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
*** 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(); | |
+ |
This file contains 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 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); | |
} |
This file contains 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
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}, |
This file contains 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
#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: |
This file contains 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
curl -vvv -ujazzychad -d"status=testing%20annotations%20again&annotations=[{\"typefoo\":{\"keyfoo\":\"valfoo\"}}]" http://api.twitter.com/1/statuses/update.xml |
This file contains 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
{ | |
"title": "First Post: Jules Verne", | |
"visbility": "public", | |
"visibility": "public" | |
} |