This file contains hidden or 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
# Iterate through Git directories and display their branch | |
# Use-case: check if we are all on master or not | |
function showcurrentbranch () { | |
find ${1:-.} -type d -path '*/.git' -printf '%h\n' -prune | xargs -I{} zsh -c \ | |
"echo {} ; pushd {} && git branch --show-current ; popd" | |
} |
This file contains hidden or 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
// From https://www.cyberciti.biz/linux-news/google-chrome-extension-to-removes-password-paste-blocking-on-website/ | |
var allowPaste = function(e){ | |
e.stopImmediatePropagation(); | |
return true; | |
}; | |
document.addEventListener('paste', allowPaste, true); |
This file contains hidden or 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
# This assumes I am using zsh, and git config --global pull.rebase true | |
function gitupdate () { | |
# https://unix.stackexchange.com/questions/333862/how-to-find-all-git-repositories-within-given-folders-fast | |
find ${1:-.} -type d -path '*/.git' -printf '%h\n' -prune | xargs -t -I{} zsh -c "pushd {} && git fetch -p && git rev-parse --abbrev-ref --symbolic-full-name @{u} && | |
git pull ; popd" | |
git fetch -p && git pull | |
} | |
function gclone () { |
This file contains hidden or 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
# Add to ~/.zprofile - ZSH-specific? Not sure | |
tmux has -t scratch &> /dev/null | |
if [ $? != 0 ]; then | |
tmux -2 new-session -s scratch -D -d | |
fi | |
if [ -z $TMUX ]; then | |
tmux attach -t scratch -d | |
fi |
This file contains hidden or 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
{"lastUpload":"2018-03-23T15:01:05.134Z","extensionVersion":"v2.9.0"} |
This file contains hidden or 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
Groovy Shell (2.4.7, JVM: 1.8.0_121) | |
Type ':help' or ':h' for help. | |
--------------------------------------------------------------------------------------------------------------------------------------- | |
groovy:000> import groovy.json.JsonSlurper | |
===> groovy.json.JsonSlurper | |
groovy:000> import groovy.json.JsonParserType | |
===> groovy.json.JsonSlurper, groovy.json.JsonParserType | |
groovy:000> parser = new JsonSlurper().setType(JsonParserType.INDEX_OVERLAY) | |
===> groovy.json.JsonSlurper@36060e | |
groovy:000> parser.parseText('''\ |
This file contains hidden or 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
(defun oth-split-and-balance () | |
"Split frame in 3 balanced windows horizontally." | |
(interactive) | |
(split-window-horizontally) | |
(split-window-horizontally) | |
(balance-windows)) | |
(global-set-key [f5] 'oth-split-and-balance) |