Skip to content

Instantly share code, notes, and snippets.

View progrium's full-sized avatar

Jeff Lindsay progrium

View GitHub Profile
#!/bin/sh
say $2 $1
#!/bin/bash
echo -e "tell application \"Quicksilver\"\nshow large type \"$1\"\nend tell" | osascript
return fetch("http://www.google.com/ig/api?weather=Mountain%20View").content.match(/<current_conditions><condition data="([^"]+)"\/>/)[1]
<3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <
<html><head><title></title></head><body>
<script type="text/javascript" src="http://www.twiliort.com/-/static/proxy.js"></script>
</body></html>
<Response>
<Say>I am about to publish some data.</Say>
<Publish channel="/test">
<Param name="foo" value="bar" />
<Param name="hello" value="world" />
</Publish>
<Say voice='woman'>Published</Say>
</Response>
from twisted.internet import reactor, ssl
from twisted.protocols import portforward
reactor.listenSSL(443, portforward.ProxyFactory(BACKEND_HOST, BACKEND_PORT), ssl.DefaultOpenSSLContextFactory(SSL_KEY_PATH, SSL_CERT_PATH))
reactor.run()
var fs = require('fs'),
Script = process.binding('evals').Script;
global['exports'] = exports;
global['require'] = require;
global['module'] = module;
global['__filename'] = __filename;
global['__dirname'] = __dirname;
Script.runInNewContext(fs.readFileSync(process.argv[2]), global, process.argv[2]);
@progrium
progrium / noded.py
Created May 18, 2010 02:47
twistd-style nodejs daemonizer
#!/usr/bin/env python
# Copyright (c) 2010 Jeff Lindsay
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
// This is a design doc for adding two methods to node via monkey patching
// that I find useful in all the little bits of HTTP glue I make. The point
// is to create a useful abstraction for forwarding requests and linking
// responses. In the most trivial case for building a reverse proxy, but
// see below for other use cases.
// API
http.ServerRequest.prototype.forward(port, host, dataFilter=null)
http.ServerResponse.prototype.attach(requestOrResponse, responseFilter=null, dataFilter=null)