Skip to content

Instantly share code, notes, and snippets.

View jeebak's full-sized avatar
🏠
Working from home

Jeebak Kim jeebak

🏠
Working from home
View GitHub Profile
@jeebak
jeebak / gist:58ce004182830b808e75
Last active October 19, 2015 22:55 — forked from junegunn/gist:f4fca918e937e6bf5bad
Browsing git commit history with fzf
# http://junegunn.kr/2015/03/browsing-git-commits-with-fzf/
# https://gist.github.com/junegunn/f4fca918e937e6bf5bad
# fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort)
fzf-git-show() {
local out shas sha q k
if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1; then
while out=$(
git log --graph --color=always \
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
@jeebak
jeebak / vm
Last active August 29, 2015 14:22
vm - An unapologetic wrapper script for VirtualBox VBoxManage
#!/usr/bin/env bash
VBM="$(command -v VBoxManage)"
[[ -z "$VBM" ]] && echo "VBoxManage not found!" && exit
PROMPT="[Target?<space>Action? or 'q' to quit] "
while [[ "$target" != "q" ]]; do
VMS_ALL="$($VBM list vms | sort)"
VMS_ALL_COUNT=$([[ ! -z "$VMS_ALL" ]] && echo "$VMS_ALL" | wc -l || echo 0)
@jeebak
jeebak / Vagrantfile
Last active January 23, 2020 22:34 — forked from anthonysterling/Vagrantfile
A vagrant replacement for ievms (for Linux, and macOS hosts)
# Usage: vagrant up windowsVersion-IEversion
#
# Eg. vagrant up win10-edge
#
# Based off of: # https://gist.github.com/anthonysterling/7cb85670b36821122a4a
boxes = {
# http://www.vagrantbox.es/
"xp-6" => "http://aka.ms/ie6.xp.vagrant",
"xp-8" => "http://aka.ms/ie8.xp.vagrant",
"vista-7" => "http://aka.ms/ie7.vista.vagrant",
@jeebak
jeebak / fzf-git-ls-files
Last active August 29, 2015 14:05
Zsh fzf-git-ls-files widget, for fzf
fzf-git-ls-files() {
if [[ -f '.git/config' ]]; then
LBUFFER="$(git ls-files | fzf +s +m -n2..,..)"
else
echo "Not a git repo\n"
fi
zle redisplay
}
@jeebak
jeebak / fzf-history-search-backward
Last active August 29, 2015 14:05
Zsh history-search-backward widget, for fzf
# https://gist.github.com/jeebak/e13c209da18ef5981792
# Derived from fzf-history-widget() that's provided by:
#
# https://github.com/junegunn/fzf
fzf-history-search-backward() {
local buffer="$BUFFER"
buffer="${buffer#"${buffer%%[![:space:]]*}"}"
buffer="${buffer%"${buffer##*[![:space:]]}"}"
# http://unix.stackexchange.com/a/11941
@jeebak
jeebak / pasteboard.bash
Last active August 29, 2015 14:05
Wrapper script for pb{copy,paste}, xsel, or text file buffer
#!/bin/bash
#
# https://gist.github.com/jeebak/b864027c7b0338832e76
#
# Wrapper for pb{copy,paste}, as symlinks to this script, that's be in your
# $PATH. i.e.,
# ln -s pasteboard.bash pbcopy
# ln -s pasteboard.bash pbpaste
# The purpose of this script is to provide the familiar pb{copy,paste} commands
# on a Mac, and in Linux, either in X (where $DISPLAY'd be set) or in a