Skip to content

Instantly share code, notes, and snippets.

@ekashida
ekashida / index.html
Created March 5, 2014 09:22
datatype-xml-parse path weirdness
<html>
<head>
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js&2.8.2r1/build/utilities/utilities.js&2.8.2r1/build/container/container-min.js&2.8.2r1/build/menu/menu-min.js&2.8.2r1/build/element/element-min.js&2.8.2r1/build/button/button-min.js&2.8.2r1/build/tabview/tabview-min.js&3.3.0/build/yui/yui-min.js&3.3.0/build/datatype/datatype-xml-parse-min.js"></script>
<script type="text/javascript" src="http://yep.video.yahoo.com/js/3/videoplayer-min.js"></script>
<script type="text/javascript">
YUI().use('videoplayer', 'console', 'node', function(Y){
@ekashida
ekashida / index.html
Created March 5, 2014 09:18
datatype-xml-parse path weirdness
<html>
<head>
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js&2.8.2r1/build/utilities/utilities.js&2.8.2r1/build/container/container-min.js&2.8.2r1/build/menu/menu-min.js&2.8.2r1/build/element/element-min.js&2.8.2r1/build/button/button-min.js&2.8.2r1/build/tabview/tabview-min.js&3.3.0/build/yui/yui-min.js&3.3.0/build/datatype/datatype-xml-parse-min.js"></script>
<script type="text/javascript" src="http://yep.video.yahoo.com/js/3/videoplayer-min.js"></script>
<script type="text/javascript">
YUI().use('videoplayer', 'console', 'node', function(Y){
var obj = new Object();
obj.id='player';

build

Clone and build Node for analysis:

$ git clone https://github.com/joyent/node.git
$ cd node
$ export GYP_DEFINES="v8_enable_disassembler=1 v8_object_print=1"
$ ./configure
$ make -j4
@ekashida
ekashida / index.css
Created October 21, 2014 04:48
Events dispatched by Good Guy Mobile Safari on almost-clicks
div {
padding: 20px 0;
margin: 5px 0;
background-color: lightgreen;
outline: 1px solid blue;
display: inline-block;
}
a {
background-color: yellow;
}
function resizeTextarea () {
while (this.get("scrollHeight") > this.get("offsetHeight")) {
this.set("rows", this.get("rows") + 1);
}
while (this.get("rows") > 3 && this.get("scrollHeight") < this.get("offsetHeight")) {
this.set("rows", this.get("rows") - 1);
}
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Eugene Kashida</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.0r4/build/reset-fonts-grids/reset-fonts-grids.css">
<style type="text/css">
require.paths.push('/usr/local/lib/node/');
var sys = require('sys'),
http = require('http'),
express = require('express'),
jsdom = require('jsdom');
var app = express.createServer();
var responseLogic = function(req, res, callback) {
var window = jsdom.jsdom().createWindow();
@ekashida
ekashida / npm segfault
Created January 23, 2011 22:35
make link seems to work
22:33:20 jib:npm $ git pull
Already up-to-date.
22:33:28 jib:npm $ ls
LICENSE Makefile README.md bin cli.js doc html lib man1 npm-completion.sh npm.js package.json scripts test
22:33:30 jib:npm $ make
node cli.js install npm
npm info it worked if it ends with ok
npm info using npm@0.2.15
npm info using node@v0.3.6-pre
npm info fetch http://registry.npmjs.org/npm/-/npm-0.2.15.tgz
@ekashida
ekashida / How to be a cafe terrorist (Mac version)
Created April 7, 2011 18:11
Many cafes limit wifi usage by keeping track of your MAC address. To get around this limitation, simply spoof your MAC address every time your session expires.
# create the following symlink if the airport command in the next step cannot be found
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
# disconnect your machine from the wireless network without turning off airport
sudo airport -z
# spoof a mac address on your wireless interface (random hex values work fine)
sudo ifconfig en1 ether 00:1f:5b:ce:0d:e4
# reconnect!
@ekashida
ekashida / gist:983495
Created May 20, 2011 18:29
Execute a collection of tasks in parallel and wait for all of them to finish before executing the callback
function doAll(collection, callback) {
var left = collection.length;
collection.forEach(function(fun) {
fun(function() {
if (--left == 0) callback();
});
});
};
var result = [];