Skip to content

Instantly share code, notes, and snippets.

Avatar
🍼
I may be slow to respond.

Junegunn Choi junegunn

🍼
I may be slow to respond.
View GitHub Profile
@junegunn
junegunn / gist:10996023
Created Apr 17, 2014
Ruby serialization
View gist:10996023
require 'msgpack'
require 'benchmark'
require 'stringio'
require 'json'
hash = (1..100000).reduce({}) { |hsh, e|
hsh[e] = ['-' * 50, '-' * 50]
hsh
}
View gist:dfcc81a54b0d824df731
#!/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
View gist:42d2285580c9890e0fd6
#!/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"
@junegunn
junegunn / align.rb
Last active Aug 29, 2015
Ruby filter for aligning tab-separated input
View align.rb
#!/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
View .vimrc
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'
@junegunn
junegunn / gist:863dcbd78eadece788cd
Created Mar 7, 2015
vagrantfile for testing vim-plug with python 2.6 compatibility
View gist:863dcbd78eadece788cd
# -*- 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
@junegunn
junegunn / gist:d779dff10a3d0a708cb7
Last active Aug 29, 2015
Managing notes with fzf
View gist:d779dff10a3d0a708cb7
#!/usr/bin/env bash
#
# Managing notes with fzf (https://github.com/junegunn/fzf)
# - CTRL-L: List txt files in descending order by their modified time
# - CTRL-F: Search file contents
NOTE_DIR="${NOTE_DIR:-$(dirname "${BASH_SOURCE[0]}")}"
TRASH_DIR="$NOTE_DIR/trash"
cd "$NOTE_DIR"
View plug.txt
plug.txt plug Last change: May 20 2015
PLUG - TABLE OF CONTENTS *plug* *plug-toc*
==============================================================================
vim-plug
Pros.
Usage
Commands
Plug options
Global options
@junegunn
junegunn / tmux-24.diff
Last active Aug 29, 2015
tmux-24.diff
View tmux-24.diff
diff --git a/colour.c b/colour.c
index b5efd6f..8098f83 100644
--- a/colour.c
+++ b/colour.c
@@ -29,12 +29,6 @@
* of the 256 colour palette.
*/
-/* An RGB colour. */
-struct colour_rgb {
@junegunn
junegunn / README.md
Last active Sep 18, 2015 — forked from steve-jansen/README.md
Stop and start Symantec Endpoint Protection on OS X
View README.md

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep