This file contains 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 | |
# Junegunn Choi ([email protected]) | |
# 2011/09/02- | |
# init.d-style daemon script for JRuby with spoon gem. | |
APP_NAME=sleeper | |
APP_PATH=/Users/jg/github/jruby-daemon/sleeper.rb | |
JRUBY=/Users/jg/.rvm/rubies/jruby-1.6.4/bin/ruby |
This file contains 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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD* 150,000 ns 0.15 ms |
This file contains 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
#!/usr/bin/env ruby | |
require 'curses' | |
Curses.init_screen | |
Curses.start_color | |
Curses.use_default_colors if Curses.respond_to? :use_default_colors | |
Curses.raw | |
Curses.noecho | |
Curses.addstr 'Hello world' | |
Curses.refresh |
This file contains 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 'msgpack' | |
require 'benchmark' | |
require 'stringio' | |
require 'json' | |
hash = (1..100000).reduce({}) { |hsh, e| | |
hsh[e] = ['-' * 50, '-' * 50] | |
hsh | |
} |
This file contains 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 | |
# Generated by vim-plug | |
# Fri Dec 5 16:35:40 2014 | |
vim +PlugUpdate +qa | |
PLUG_HOME=~/.vim/plugged | |
cd $PLUG_HOME/Vim-Jinja2-Syntax/ && git reset --hard 4eb6761 | |
cd $PLUG_HOME/ack.vim/ && git reset --hard 303bcef |
This file contains 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
#!/usr/bin/env bash | |
output=$(fzf --print-query --multi) | |
mapfile -t lines <<< "$output" | |
query="${lines[0]}" | |
matches=(${lines[@]:1}) | |
echo "Query: $query" | |
if [ ${#matches[@]} -eq 0 ]; then | |
echo "- No result" |
This file contains 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
#!/usr/bin/env ruby | |
lines = [] | |
maxes = [] | |
while raw = gets | |
lines << line = raw.chomp.split(/\t+/) | |
line.each_with_index do |token, idx| | |
maxes[idx] = [maxes.fetch(idx, 0), token.length].max | |
end | |
end |
This file contains 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
echom 'xxx' |
This file contains 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
call plug#begin('~/.vim/bundle') | |
Plug 'bling/vim-airline' | |
Plug 'tpope/vim-fugitive' | |
Plug 'valloric/YouCompleteMe' | |
Plug 'SirVer/ultisnips' | |
Plug 'scrooloose/nerdtree' | |
Plug 'scrooloose/nerdcommenter' | |
Plug 'airblade/vim-gitgutter' | |
Plug 'kien/ctrlp.vim' |
This file contains 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "lucid" | |
config.vm.box_url = "https://dl.dropbox.com/u/14741389/vagrantboxes/lucid64-lamp.box" | |
config.vm.provision "shell", inline: <<-SHELL | |
sudo apt-get update | |
sudo apt-get install -y git-core vim |
OlderNewer