Skip to content

Instantly share code, notes, and snippets.

Avatar

Jaeho Shin netj

View GitHub Profile
View quickSort-results.csv
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
View get-3x
#!/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}
View ftp.kaist.ac.kr-bwtest.sh
#!/usr/bin/env bash
# A script for checking bandwidth of KAIST FTP's new network
# Usage: curl -sL https://gist.github.com/netj/5d95a999da6088c57f64/raw/ftp.kaist.ac.kr-bwtest.sh | bash -s [TIMEOUT] [PATH]
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2014-09-25
set -eu
# ftp.kaist.ac.kr IPs
ipCurrent=143.248.234.110
View assert.cc
#include <cassert>
int main() {
// The following line may crash the code
// Try: g++ assert.cc && ./a.out
assert(false);
// But only if it weren't compiled with NDEBUG macro defined.
// Now try: g++ -DNDEBUG assert.cc && ./a.out
return 0;
// See: http://en.cppreference.com/w/cpp/error/assert
@netj
netj / a.log
Last active Aug 29, 2015
LaTeX Font Warning messages example for vim-latex/vim-latex#21
View a.log
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013) (format=pdflatex 2013.5.30) 7 JUN 2015 02:42
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**a.tex
(./a.tex
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 78 languages loaded.
(/opt/texlive/2013/texmf-dist/tex/latex/base/article.cls
View esplay.sh
#!/usr/bin/env bash
# A script to create a Elasticsearch playground with GVim
set -eu
mkdir -p esplay.d
cd esplay.d
# prepare a query running script
echo >_search.sh '#!/usr/bin/env bash
set -eu
@netj
netj / take-a-break-with
Created May 17, 2010
Take-a-Break script for the Mac user's health
View take-a-break-with
#!/bin/bash
# take-a-break-with -- Take-a-Break script for the Mac user's health
#
# Schedule calling this script regularly from your crontab:
#
# */60 * * * * take-a-break-with Dashboard
#
# When a Growl bubble comes up, click it and take a break! :)
#
# You need to get and install Growl from: http://growl.info/
@netj
netj / blinker
Created May 25, 2010
an effective tool for instilling vocabularies into your brain
View blinker
#!/bin/bash
# The "Blinker" (or "깜빡이" in Korean) for Mac
# an effective tool for instilling vocabularies into your brain
#
# Usage: blinker [-OPTION...] SET...
#
# SET is the path to a file where each of its line contains a word and its
# definition separated by tab character. You can get lots of quality sets
# from http://quizlet.com/.
#
@netj
netj / git-mark-empty-dirs
Created Jun 13, 2010
Mark empty dirs in a git repo with .gitignore files
View git-mark-empty-dirs
#!/usr/bin/env bash
# git-mark-empty-dirs -- Mark empty dirs in a git repo with .gitignore files
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2009-12-03
set -e
remove-or-mark() {
local d=$1; shift
interact() {
echo "Found empty dir: \`$d'"
@netj
netj / customize
Created Jun 13, 2010
Substitute contents and names of given files
View customize
#!/usr/bin/env bash
# customize -- Substitute contents and names of given files
#
# Usage:
# customize DEST [FILE...] <<RULES
# Name=Foo
# Version=1.0
# RULES
#
#