Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am ryanstevens on github.
* I am ryan_stevens (https://keybase.io/ryan_stevens) on keybase.
* I have a public key whose fingerprint is 055D BFAE 3ED0 F75E EABD 7AE9 89D6 2F51 91AC 539D
To claim this, I am signing this object:
var microdom = require('microdom');
var createSOAPClient = require('soap').createClient;
var argv = require('optimist').argv;
var Table = require('cli-table');
// ref: http://graphical.weather.gov/xml/
createSOAPClient(
'http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl',
function clientCreated(err, client) {
@ryanstevens
ryanstevens / gist:1338955
Created November 4, 2011 08:59
Testling runtime test eror (error in my test file)
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object function (name, cb) {
if (typeof name === 'function') {
cb = name;
name = undefined;
}
var t = new Test(name, test.push);
@ryanstevens
ryanstevens / apply arguments
Created December 21, 2011 08:20
This shows you can pass arguments directly into apply
var test = require("testling")
test("Apply arguments", function(t) {
function fn(p1, p2) {
t.equal(p1, 10);
t.equal(p2, 20);
}
var test = require('testling');
//run qunit or mocha test here
var tapOutput = qunit.getTapOutput();
test.consumeTap(tapOutput);
arn: Creating new snapshot for version 0.2.0-31
info: Done creating snapshot 0.2.0-31
info: Updating application rootmusic-opg-test
info: Activating snapshot 0.2.0-31 for rootmusic-opg-test
info: Stopping app rootmusic-opg-test
info: App rootmusic-opg-test is now stopped
info: Starting app rootmusic-opg-test
help:
help: Usage:
help:
var request = require('request');
var cls = require('continuation-local-storage');
var ns = cls.createNamespace('test');
ns.run(function() {
ns.set('foo', 'bar');
setTimeout(function() {
console.log("This is fine " + ns.get('foo'));
}, 0);
var proxyServer = httpProxy.createServer(function (req, res, proxy) {
//look for anything with "socket" in the sub-domain and route to node, otherwise route to php
var host = req.headers.host,
target = routes.getTarget([host]);
if (!target) {
logger.error("No route for " + host+", cannot serve "+req.url);
res.end();
return;
npm WARN package.json bufferpack@0.0.6 No readme data.
npm ERR! tar.unpack untar error /home/ryan/tmp/npm-17888/1386617568447-0.15539880678988993/tmp.tgz
npm ERR! tar.unpack untar error /home/ryan/tmp/npm-17888/1386617568447-0.15539880678988993/tmp.tgz
npm ERR! Error: invalid tar file
npm ERR! at Extract.Parse._startEntry (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:144:13)
npm ERR! at Extract.Parse._process (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:125:12)
npm ERR! at BlockStream.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/tar/lib/parse.js:46:8)
npm ERR! at BlockStream.EventEmitter.emit (events.js:96:17)
npm ERR! at BlockStream._emitChunk (/usr/local/lib/node_modules/npm/node_modules/block-stream/block-stream.js:145:10)
npm ERR! at BlockStream.resume (/usr/local/lib/node_modules/npm/node_modules/block-stream/block-stream.js:58:15)
@ryanstevens
ryanstevens / Example.html
Created May 18, 2011 21:34 — forked from 140bytes/LICENSE.txt
Countdown Timer
<!--.
This example will start at 5 seconds and countdown to 0 (ish). It will update the div "about" every 1/2 second.
-->
<div id='test></div>
<script type='text/javascript'>
(function(o, i, f){
var g='getTime',
z=o=o+new Date()[g](),
b = function(){