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 / 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
@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 / 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 / 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 / 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 / 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 / git-pie-ify
Last active October 22, 2015 02:42
Apply the pie, on the fly
#!/usr/bin/env bash
#
# https://gist.github.com/jeebak/f9088cede18d31f2d3a0
#
# Added to: https://github.com/unixorn/git-extra-commands
# Further updates will be there.
#
[[ $# -ne 2 ]] && echo "Usage: git pie-ify pattern replacement" 1>&2 && exit 1
@jeebak
jeebak / boxstarter.ps1
Last active August 18, 2022 15:10
My Boxstarter Script
#
# https://github.com/tknerr/bills-kitchen
# All you need for cooking with Chef and Vagrant on Windows you will find in Bill's Kitchen
# https://github.com/tknerr/linus-kitchen
# An Ubuntu-based developer VM for hacking with Chef, Vagrant, Docker & Co
#
# Based on: https://github.com/felixrieseberg/windows-development-environment
# Test-Admin is not available yet, so use...
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
@jeebak
jeebak / hack-mac-slack.bash
Last active December 15, 2019 08:01
Appends slack-night-mode CSS to a Slack .js file. For Mac only
#!/usr/bin/env bash
# https://gist.github.com/DrewML/0acd2e389492e7d9d6be63386d75dd99
# https://github.com/widget-/slack-black-theme
# https://github.com/laCour/slack-night-mode/
# No longer relevant
@jeebak
jeebak / AdvancedWindowSnap.ahk
Last active August 16, 2017 07:28 — forked from AWMooreCO/AdvancedWindowSnap.ahk
Advanced Window Snap is a script for AutoHotKey that expands upon Windows built-in window-snapping hotkeys.
/**
* Forked from: https://gist.github.com/AWMooreCO/1ef708055a11862ca9dc
*
* Advanced Window Snap
* Snaps the Active Window to one of nine different window positions.
*
* @author Andrew Moore <andrew+github@awmoore.com>
* @version 1.0
*/