Skip to content

Instantly share code, notes, and snippets.

View netj's full-sized avatar

Jaeho Shin netj

View GitHub Profile
// ==UserScript==
// @name Faviconize Google (nested icons)
// @namespace http://userscripts.ru/js/faviconize-google/
// @description Adds favicons to each link offered by Google search results.
// @include http://www.google.*/search?*
// @include https://www.google.*/search?*
// @include https://encrypted.google.*/search?*
// @include http://www.google.*/webhp*
// @include http://www.google.*/
// @include http://groups.google.*/groups/search?*
@netj
netj / bookmarklet.js
Created July 25, 2013 17:43
Download YouTube Subtitle — Run this bookmarklet on a YouTube video page to download its subtitle.
/* Created with YouScript Bookmarklet Editor
* http://netj.github.com/youscript/
*/
var m = location.href.match(/youtube.com\/watch\?(.+[&])?v=([^&]+)/);
if (m != null) {
var videoId = m[2];
function askLanguageAndDownload() {
var lang = "en";
// figure out the first available language for subtitle
@netj
netj / bookmarklet.js
Created August 3, 2013 16:36
Print Mint.com Transactions as seen — Use this to print or save as pdf your transactions organized in Mint.com as seen on the screen. Mint.com pages are normally mangled when you try to print without the help of this bookmarklet.
/* 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";
s.onload = function() {
$("link[rel='stylesheet']", document.head).attr("media", null);
$("#body-container .layer:last").css("display", "none");
print();
From 0d949aa6169963ce5d6a55e15bcd9757e4c044eb Mon Sep 17 00:00:00 2001
From: Jaeho Shin <netj@sparcs.org>
Date: Tue, 10 Sep 2013 05:24:39 +0900
Subject: [PATCH] Simon Wilkinson's openssh gsskex patch for 6.2p2
Revised Simon's last patch for 5.7p1 [1] to apply cleanly to 6.2p2.
[1]: http://www.sxw.org.uk/computing/patches/openssh-5.7p1-gsskex-all-20110125.patch
---
From 839231516fe46ae5709658676ffa1d5463940e6b Mon Sep 17 00:00:00 2001
From: Jaeho Shin <netj@sparcs.org>
Date: Tue, 10 Sep 2013 19:14:07 +0900
Subject: [PATCH] Simon Wilkinson's gsskex patch for 6.2p2
Revised Simon's last patch for 5.7p1 [1] to apply cleanly to 6.2p2.
[1]: http://www.sxw.org.uk/computing/patches/openssh.html
---
ChangeLog.gssapi | 113 +++++++++++++++++++
@netj
netj / .cshrc
Last active January 4, 2016 21:49
Automatically switch to bash from tcsh/csh. Place the snippet at the beginning of your `~/.cshrc` and `~/.login` files.
# XXX I use GNU BASH
# See: http://tuukka.iki.fi/linux/tweaks/bashovertcsh.html
# If this is login or some command is to be executed
# then change to a sane shell
if ($?loginsh || $?command) then
setenv SHELL /bin/bash
if($?loginsh) exec /bin/bash --login
exec /bin/bash -c "$command"
endif
Algorithm Input Size Input Type Sorting Time #Compare #Access
quickSort 15 random 0.390538 572959 1519407
quickSort 16 random 0.788945 1199432 2991392
quickSort 17 random 1.763706 2644539 6656851
sepal.length sepal.width petal.length petal.width variety
5.1 3.5 1.4 .2 Setosa
4.9 3 1.4 .2 Setosa
4.7 3.2 1.3 .2 Setosa
4.6 3.1 1.5 .2 Setosa
5 3.6 1.4 .2 Setosa
5.4 3.9 1.7 .4 Setosa
4.6 3.4 1.4 .3 Setosa
5 3.4 1.5 .2 Setosa
4.4 2.9 1.4 .2 Setosa
@netj
netj / get-3x
Last active August 29, 2015 13:56
#!/usr/bin/env bash
# Download and install 3X: a Workbench for eXecuting eXploratory eXperiments
# Usage: curl -s https://gist.github.com/netj/9065580/raw/get-3x | bash -s release=LATEST dest=~/bin
set -eu
# export any given definition as arguments
export "$@"
# defaults to downloading the LATEST release, installing at $HOME/bin/
: ${release:=LATEST} ${dest:=~/bin}
#!/usr/bin/env bash
# mosh-server wrapper for Kerberos/AFS home environment
#
# Author: Jaeho Shin <netj@cs.stanford.edu>
# Created: 2014-04-25
# Requires: readlink in GNU coreutils
set -eu
self=$(readlink -f "$0")
next=$(type -ap mosh-server | xargs -L1 readlink -f |