This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define FOR(i, b, e) for (typeof(e) i = (b); i < (e); ++i) | |
// for arrays | |
#define arrsz(a) ( sizeof(a) / sizeof(a[0]) ) | |
#define darr(a) if (opt_debug) { copy( (a), (a) + arrsz(a), ostream_iterator<int>(cerr, " ") ); cerr << endl; } | |
#define darr2(a) if (opt_debug) { FOR(__i, 0, (arrsz(a))){ darr( (a)[__i] ); } } | |
// for vectors | |
#define ALL(a) (a).begin(), (a).end() | |
#define dvec(v) if (opt_debug) { copy( ALL(v), ostream_iterator<int>(cerr, " ") ); cerr << endl; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
TOKEN = "CDC4L3EA1BEVS662EP0MALI7UVC8L357" | |
class GA | |
GENES_LIMIT = 100 | |
SELECTION_COUNT = 50 | |
CROSSOVER_COUNT = 45 | |
RANDOM_COUNT = 5 | |
MUTATION_PERCENTAGE = 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 (right|left)" | |
exit 1 | |
fi | |
current_win=$(tmux display-message -p '#I') | |
total_win_count=$(tmux display-message -p '#{session_windows}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if not in tmux session | |
if [ -z $TMUX ]; then | |
# jump into new session | |
tmux new-session | |
# exit when coming back from the tmux session | |
exit | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inoremap <expr> = smartchr#loop(' = ', ' == ', ' => ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inoremap <silent> <buffer> <Leader><C-l> <Space>>><Space> | |
inoremap <silent> <buffer> <Leader><C-h> <Space><<<Space> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inoremap <silent> <buffer> <Leader><C-l> <Space>=><Space> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
function run_test { | |
targets=$(git diff --cached --name-only) | |
orig_files=() | |
for file in $targets; do | |
if [ $(echo $file | grep '.*\.orig$') ]; then | |
orig_files=("${orig_files[@]}" "$file") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd BufNew * NeoSnippetSource /path/to/snippet/file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippet r; | |
abbr Repository | |
options word | |
Repository | |
snippet r_; | |
abbr repository | |
options word | |
repository | |
snippet r:b; | |
abbr Repository::Bazaar |