Skip to content

Instantly share code, notes, and snippets.

View netj's full-sized avatar

Jaeho Shin netj

View GitHub Profile
@netj
netj / bookmarklet.js
Created July 17, 2012 09:14
Inject jQuery — Add jQuery to the current web page
/* Created with YouScript Bookmarklet Editor
* http://netj.github.com/youscript
*/
var s = document.createElement("script");
s.src = "http://code.jquery.com/jquery-latest.min.js";
document.body.appendChild(s);
@netj
netj / bookmarklet.js
Created July 17, 2012 09:27
Read RFC in HTML — Open an HTML version of this RFC document
/* Created with YouScript Bookmarklet Editor
* http://netj.github.com/youscript
*/
if (m=location.href.match(/http:\/\/((.*\.)?ietf\.org\/(rfc|html)|(.*\.)?faqs\.org\/rfcs)\/(rfc[0-9]*)/i)) {
location="http://tools.ietf.org/html/"+m[m.length-1];
} else {
alert("Unrecognized RFC URL: "+location.href);
}
@netj
netj / bookmarklet.js
Created July 27, 2012 07:52
Expand all Hadoop MapReduce Task logs — Checking task logs from Hadoop MapReduce web UI is a pain. This bookmarklet saves a lot of clicks! Simply run this once from any page showing a table of tasks, and you'll see every task log on the same page.
/* Created with YouScript Bookmarklet Editor
* http://netj.github.com/youscript/
*/
/*
Checking task logs from Hadoop MapReduce web UI is a pain. This bookmarklet saves a lot of clicks! Simply run this once from any page showing a table of tasks, and you'll see every task log on the same page. You can specify the amount of log to tail, and this will refresh every 30s. To circumvent web security, you need to run node-jsonp-proxy on your machine, available at: https://github.com/clintandrewhall/node-jsonp-proxy
*/
var topRowsToExpand = localStorage.expandTaskLogs_topRowsToExpand || 100;
var tasklogFilter = localStorage.expandTaskLogs_tasklogFilter || "syslog";
@netj
netj / bookmarklet.js
Created July 28, 2012 06:31
Pop Web Video — Pop the video playing on this web page into an exactly-sized window.
/* Created with YouScript Bookmarklet Editor
* http://netj.github.com/youscript/
*/
var minWidth = 300; var minHeight = 200;
function getVideoElement(w) {
// find the HTML5 video, or other likely video containers
if (!w || !w.document || !w.document.getElementsByTagName) return null;
function findVideoElementFrom(vs) {
for (var i=0; i<vs.length; i++) {
@netj
netj / jsonp-proxy.py
Created August 15, 2012 22:34
A primitive JSON-P proxy in Python compatible to node-jsonp-proxy
#!/usr/bin/env python
# A very primitive JSON-P proxy in Python
# Derived from Patric Fornasier's Blog: http://patforna.blogspot.com/2009/03/jsonp-proxy-server.html
# Made compatible with node-jsonp-proxy: https://github.com/clintandrewhall/node-jsonp-proxy
import urllib,re
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class RequestHandler(BaseHTTPRequestHandler):
@netj
netj / bookmarklet.js
Created September 25, 2012 15:49
Scholarize Search — Search the same thing from Google Scholar.
/* Created with YouScript Bookmarklet Editor
* http://netj.github.com/youscript/
*/
location="http://scholar.google.com/scholar"+location.search;
joyent/node
v8/v8
greasemonkey/greasemonkey
jquery/jquery
sstephenson/prototype
twitter/bootstrap
mbostock/d3
DmitryBaranovskiy/raphael
tree e6819163e76264f778efe7fcb480d0f108d3aaf5
parent d2771a2c3e23bedf2018df1519b560873a0b35eb
author Jaeho Shin <netj@sparcs.org> Thu Dec 13 22:57:44 2012 -0800
committer Jaeho Shin <netj@sparcs.org> Thu Dec 13 22:57:44 2012 -0800
Fixed backslash handling in environment Change
diff --git a/ftplugin/latex-suite/envmacros.vim b/ftplugin/latex-suite/envmacros.vim
index edf97f7..3e1db37 100644
#!/bin/sh
Self=`readlink -f "$0"`
Here=`dirname "$Self"`
#
# Add extra JVM options here
#
OPTS="-Xms64m -Xmx256m"
@netj
netj / _wordcloud.coffee
Last active December 18, 2015 04:49
wordcloud.coffee -- A phantomjs script for creating wordcloud images from command-line using Jason Davies' d3-cloud
#!/usr/bin/env phantomjs
# wordcloud.coffee -- A phantomjs script for creating wordcloud images from
# command-line using Jason Davies' d3-cloud
# Usage: keyword=wordle ./wordcloud.coffee [OUTPUTPATH]
# Creates a wordcloud image at the given path OUTPUTPATH.
# OUTPUTPATH can be either a .png or .pdf.
#
# See: Jason Davies' d3-cloud demo <http://www.jasondavies.com/wordcloud/>
#
# Author: Jaeho Shin <netj@cs.stanford.edu>