Skip to content

Instantly share code, notes, and snippets.

View netj's full-sized avatar

Jaeho Shin netj

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/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 / a.log
Last active August 29, 2015 14:22
LaTeX Font Warning messages example for vim-latex/vim-latex#21
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
@netj
netj / README.md
Last active May 20, 2016 06:54
An example for reproducing an errorformat bug in vim-latex for filename tracking

An example for vim-latex/vim-latex#20. With vim-latex installed, run the following command

vim -o a.tex b.tex a.log +'set ft=tex autoread makeprg=pdflatex\ \\\\nonstopmode\ \\\\input\\{%} | make | copen'

The quickfix window should show b.tex as the file names, but the bug in errorformat makes vim lose track of filenames.

@netj
netj / assert.cc
Last active August 29, 2015 14:16
#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
#!/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
#!/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 |
@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}
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