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
var http = require('http'), crypto = require('crypto'), fs = require('fs');
var server = http.createServer(function(request, response) {
request.headers['X-Forwarded-Proto'] = 'https';
request.headers['X-Forwarded-For'] = request.connection.remoteAddress;
var proxyRequest = http.createClient(80, 'localhost')
.request(request.method, request.url, request.headers);
request.addListener('data', function(data) { proxyRequest.write(data); });
request.addListener('end', function() { proxyRequest.end(); });