Skip to content

Instantly share code, notes, and snippets.

View joshthecoder's full-sized avatar

Joshua Roesslein joshthecoder

View GitHub Profile
import text/regexp/Regexp
main: func {
r := Regexp new("^test$")
if (r matches("test")) {
"match!" println()
}
}
HeaderMap: class extends HashMap<String> {
init: func ~headermap {
init(100)
}
init: func ~headermapWithCapacity (capacity: UInt) {
T = String
super(capacity)
}
}
@joshthecoder
joshthecoder / gist:322500
Created March 5, 2010 06:34
GSOC project ideas for ooc
ooc Google Summer of Code project ideas
=======================================
- rock backend (llvm, javascript, jvm?)
- testing framework
- ooc-web improvements
- true exception support
- game/graphics engine (maybe bind ogre or start from scratch?)
- reincarnate and/or package store
- database library (couchdb, mongodb, sql)
factorial: func(n: Int) -> Double {
result: Double = 1
while(n != 0) {
result *= n
n -= 1
}
return result
}
Colors: enum { red, blue, green }
Animals: enum {
monkey
bird
cow
dog
}
import tweepy
auth = tweepy.OAuthHandler(consumer_token, consumer_secret)
auth.get_xauth_access_token(username, password)
# you can then use this for API access...
api = tweepy.API(auth)
api.update_status("hello")
# to get the access token object for storing...
/*
Using the streaming API to pump data
read from a socket into a file.
*/
// Assume we have opened both a socket and file.
var socket = ...;
var file = ...;
// First create a pump object to perform the transfer of data.
/*
* event-emitter-plus.js
*
* An extended EventEmitter with the following new additions:
* + mapEvents(events) - Add the following listeners to the event specified by their key.
*/
events = require("events");
events.EventEmitter.prototype.mapEvents = function (events) {
@joshthecoder
joshthecoder / Questions
Created June 20, 2011 23:41
Kiwi Pycon Give-away
GitHub username: joshthecoder
Day job: Software developer for Appcelerator working on Titanium Desktop.
Favorite open source project: Titanium
Open Source contributions (if any): Can't remember how many, but I do spend in my spare time sending patches to many projects.
Stranded on an island, what 3 items do you take: knife, tent, a good book
Tie-breaker, pick a number between 1 and 20,000: 19,999
@joshthecoder
joshthecoder / gist:1167392
Created August 24, 2011 05:54 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job: programmer for Appcelerator, Inc.
Favorite Python project: pypy
Favorite Conference: CodeConf!
Python Experience Level: Experienced