View .tmux.conf
#change prefix from C-b to C-a | |
unbind C-b | |
set -g prefix C-a | |
#theme | |
set -g default-terminal "tmux-256color" | |
set-option -ga terminal-overrides ",xterm-256color:Tc" | |
#-------------------------------------------------------# | |
##STATUS LINE/MESSAGES AT BOTTOM |
View pre-commit
#!/bin/bash | |
# How to use? | |
# - Save this file as .git/hooks/pre-commit in your project .git folder | |
# - Execute: | |
# chmod +x .git/hooks/pre-commit | |
# | |
# If you want to skip the hook just add the --no-verify flag: | |
# git commit --no-verify |
View pre-commit
#!/usr/bin/env ruby | |
# How to use? | |
# - Save this file as .git/hooks/pre-commit in your project .git folder | |
# - Execute: | |
# chmod +x .git/hooks/pre-commit | |
# | |
# If you want to skip the hook just add the --no-verify flag: | |
# git commit --no-verify |
View test_fcm.rb
# source: http://www.rubyinside.com/nethttp-cheat-sheet-2940.html | |
# FCM ref: https://medium.com/@cdmunoz/working-easily-with-fcm-push-notifications-in-android-e1804c80f74 | |
# How to run in terminal: ruby test_fcm.rb | |
require 'net/https' | |
require 'uri' | |
require 'json' | |
uri = URI.parse('https://fcm.googleapis.com/fcm/send') | |
device_token = 'FCM_device_token' | |
header = { |
View input_source
#!/bin/bash | |
input_name=$(defaults read ~/Library/Preferences/com.apple.HIToolbox.plist AppleSelectedInputSources | egrep -w 'KeyboardLayout Name' | sed -E 's/^.+ = \"?([^\"]+)\"?;$/\1/') | |
if [[ -z "$input_name" ]]; then | |
echo "V.N" | |
elif [[ -n "$input_name" ]]; then | |
echo "U.S" | |
fi |
View file_preview
#!/bin/bash | |
file="$1" | |
[[ $(file --mime "$file") =~ binary ]] && | |
echo "$file" is a binary file || | |
(bat --style=numbers --color=always "$file" || | |
highlight -O ansi -l "$file" || | |
coderay "$file" || | |
rougify "$file" || | |
cat "$file") 2> /dev/null | head -500 |
View gitcheats.txt
# shortform git commands | |
alias g='git' | |
# get a list of all commit messages for a repo | |
git log --pretty=format:'%s' | |
# pull all git repos to current version | |
find . -name .git -type d -execdir git pull -v | |
# pull all git repos to currenrt version |
View git_fzf.sh
# git log show with fzf | |
# | |
# https://gist.github.com/tamphh/3c9a4aa07ef21232624bacb4b3f3c580/edit | |
# https://asciinema.org/a/257939 | |
# | |
# git log show with fzf | |
gli() { | |
# param validation |