Skip to content

Instantly share code, notes, and snippets.

View reid's full-sized avatar

Reid Burke reid

View GitHub Profile
[rburke@gonechildren-lm 529 ~/npwhat]
$ npm link .
The "ini" module will be removed in future versions of Node, please extract it into your own code.
npm configfile /Users/rburke/.npmrc
npm sudo false
npm cli [ 'link', '.' ]
npm link /Users/rburke/npwhat
npm link /Users/rburke/npwhat is a directory
npm link reading /Users/rburke/npwhat/package.json
npm readJson /Users/rburke/npwhat/package.json
[rburke@gonechildren-lm 659 ~/working/narwhal-lib]
$ node-repl
Welcome to the Node.js REPL.
Enter ECMAScript at the prompt.
Tip 1: Use 'rlwrap node-repl' for a better interface
Tip 2: Type Control-D to exit.
Type '.help' for options.
node> require("kiwi").require("narwhal-lib")
TypeError: Object ---
name: narwhal-lib
<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.1.1/build/yui/yui-min.jsamp;&3.1.1/build/loader/loader-min.js"></script>
@reid
reid / run-yui3-tests.php
Created August 9, 2010 15:41
YUI3 smoke test launcher
<?php
// place this file in yui3/src
// usage: php run-yui3-tests.php
$txt = file_get_contents("common/tests/smoketests.xml");
$xml = new SimpleXMLElement($txt);
$urls = array();
<?php
$ret = 0;
$cmd = "yeti fixture.html --solo 1";
while (1) {
print "$cmd\n";
passthru($cmd, $ret);
if ($ret) exit($ret);
sleep(0.5);
<?php
$file = <<<EOF
attribute/tests/attribute.html
async-queue/tests/async-queue.html
cache/tests/cache.html
cache/tests/cacheoffline.html
classnamemanager/tests/classnamemanager.html
collection/tests/arraylist.html
collection/tests/collection.html
// snippet fron inject.js
(function attachEventsToYUITest () {
if (!window.YUITest) return window.setTimeout(attachEventsToYUITest, 15);
var pulse = window.TestSwarm.heartbeat;
var Runner = window.YUITest.TestRunner;
Runner.on(Runner.BEGIN_EVENT, pulse);
@reid
reid / npm-pump
Created September 15, 2010 20:55
npm verb downloaded 92%
npm verb fetched http://registry.npmjs.org/npm/-/npm@0.2.0.tgz - 584048 bytes
npm verb execTar strip-components
npm ERR! Failed unpacking the tarball with the strip-components option.
npm ERR! Consider upgrading tar.
npm verb execTar strip-path
npm ERR! Error: Stream is not writable
npm ERR! at Stream._writeOut (net:679:11)
npm ERR! at Stream.write (net:665:17)
npm ERR! at Stream.<anonymous> (sys:290:21)
From a5964ad256219738997f7b97505e3e3fe4d50f60 Mon Sep 17 00:00:00 2001
From: Reid Burke <me@reidburke.com>
Date: Wed, 15 Sep 2010 16:38:05 -0700
Subject: [PATCH] sys.pump: only write to a stream if it's writable.
If the writeStream's writable property is false,
do not attempt to write to it. Otherwise, plenty
of uncaught exceptions occur before the stream closes.
---
lib/sys.js | 4 ++-
@reid
reid / slider-horizontal.html
Created September 25, 2010 00:56
A basic horizontal slider.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Basic Sliders</title>
<style type="text/css">
/*margin and padding on body element
can introduce errors in determining
element position and are not recommended;