Skip to content

Instantly share code, notes, and snippets.

@tmpvar
tmpvar / gist:6198731
Last active December 20, 2015 21:38 — forked from anonymous/gist:6198729
# booting into arch livecd (thumbdrive)
grab the arch linux iso - https://www.archlinux.org/download/
open terminal
```bash
cd /path/to/downloads
diskutil list
@tmpvar
tmpvar / j.json
Created April 17, 2013 20:02 — forked from isaacs/j.json
{
"package": {
"properties": {
"author": {
"type": "string"
},
"created": {
"type": "date",
"format": "dateOptionalTime"
},
@tmpvar
tmpvar / output
Created June 12, 2012 19:40 — forked from nym/gist:2918959
Script tag not loading
var jsdom = require('jsdom');
jsdom.defaultDocumentFeatures = {
FetchExternalResources : ['script'],
ProcessExternalResources : ['script'],
MutationEvents : '2.0',
QuerySelector : false
};
var htmlDoc = '<html lang="en-US">' +
@tmpvar
tmpvar / gist:1033715
Created June 19, 2011 03:03 — forked from itissid/gist:709246
jsdom port
//TO USE JUST save it and FIRE node <filename.js>
//AT THE BOTTOM THERE ARE TWO URL'S. TEST CASE IS FOR URL POINTING TO SUN'S JAVADOC ,A PAGE THAT MAKEE HEAVY //USE OF IFRAMES
// Should process HTML text and dump it on terminal
// Error on terminal with a backtrace
/*
/home/sid/opt/lib/node/.npm/jsdom/0.1.20/package/lib/jsdom/level2/html.js:1400
this._contentDocument = new HTMLDocument();
^
ReferenceError: HTMLDocument is not defined
at Object.contentDocument (/home/sid/opt/lib/node/.npm/jsdom/0.1.20/package/lib/jsdom/level2/html.js:1400:9)
@tmpvar
tmpvar / hookio-IDST.md
Created June 12, 2011 16:27
hook.io request for comments time

What is a hook?

  • A hook is a node.js process

  • A hook can have many outputs ( servers ) and inputs ( client connections ) to other hooks

  • The previous line is NOT a typo

  • outputs =  servers ( who push messages out )

  • inputs   =  clients   ( who take messages in )

  • inputs and outputs are independent channels and are both bi-directional

  • hook inputs ALWAYS re-broadcast to it's outputs immediate inputs ( siblings )

@tmpvar
tmpvar / level3.md
Created May 26, 2011 22:05 — forked from lloyd/level3.md

This perhaps deserves a blog post, but whatever.

The challenge: What if you wanted to determine what level my Bulgarian language skills were at? Using this sample document:

{
    "name": {
        "first": "Lloyd",
        "last": "Hilaiel"
    },

"favoriteColor": "yellow",

@tmpvar
tmpvar / LICENSE.txt
Created May 20, 2011 02:51 — forked from 140bytes/LICENSE.txt
hatch - the smallest hash based router you've ever seen
Copyright (c) 2011 Elijah Insua, http://tmpvar.com
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 conditions:
@tmpvar
tmpvar / gist:755614
Created December 26, 2010 20:43 — forked from mikeal/gist:755612
getdom = function () {
var features =
{ FetchExternalResources : []
, ProcessExternalResources : false
}
, window = jsdom.jsdom(this.dataString, null, {features: features}).createWindow()
;
return window
}
@tmpvar
tmpvar / gist:661922
Created November 4, 2010 00:02 — forked from aflatter/gist:661873
node context issues
var common = require('../common'),
assert = common.assert;
var Script = process.binding("evals").Script;
var sandbox = Script.createContext({x: "x"});
sandbox.window = sandbox;
//Script.runInContext("window = this;", sandbox);
@tmpvar
tmpvar / gist:639934
Created October 22, 2010 04:24 — forked from Valid/gist:639917
var sys = require('sys'),
http = require('http'),
cookie = require('cookie'),
count = 0;
initConnect = function(clientID) {
connectSite = http.createClient(80, 'ws30.sync.skoreit.com');
connectRequest = connectSite.request('POST', '/request.ashx?key=11111111-1111-1111-1111-111111111111&token=' + new Date().getTime(), {
'host': 'ws30.sync.skoreit.com',
'Content-type': 'text/json; charset=utf-8',