Skip to content

Instantly share code, notes, and snippets.

View GeneralD's full-sized avatar
💭
Alcohol makes better code 🥃

YUMENOSUKE GeneralD

💭
Alcohol makes better code 🥃
View GitHub Profile
# zmv
autoload -Uz zmv
alias zmv='noglob zmv -W'
# Java use IPv4 for jenkins
alias jenkins='env _JAVA_OPTIONS="-Djava.net.preferIPv4Stack=true" jenkins'
constructor(private iab: InAppBrowser) {}
openUrl(url: string, externalBrowser: boolean = false) {
const target = externalBrowser ? '_system' : '_blank';
this.iab.create(url, target, TopicDetailPage.options);
}
# usage sample: echo Let\'s ${RED}color${CLEAR} text!
CLEAR='\033[0m'
BLACK='\033[0;30m'
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
MAGENTA='\033[0;35m'
CYAN='\033[0;36m'
# Mac Applications in 'Applications' directories -> runnable from the terminal
() {
local app dir
for dir in $@; do
for app in $dir/*.app(N); do; alias ${app:t:r:gs/ //}="open -a ${app:gs/ /\\ /}"; done
for app in $dir/*/*.app(N); do; alias ${app:t:r:gs/ //}="open -a ${app:gs/ /\\ /}"; done
done
} /Applications ~/Applications
# Open the directory with Finder (Open current directory without argument)
#!/usr/bin/env sh
## This script uses several commands. They can be install with...
## $ gem install notify-my-android
## $ gem install prowl
## $ brew install terminal-notifier
NMA_KEY=${NMA_KEY:-"YOUR_KEY"}
PROWL_KEY=${PROWL_KEY:-"YOUR_KEY"}
#!/usr/bin/env bash
# Parameters
NBINS=20
INTERVAL=1
PROCESSES=("Google Chrome")
# Set process
if [ $# -gt 0 ];then
PROCESSES=("$@")
#!/usr/bin/env zsh
if [[ $# -lt 2 ]]; then
echo "Usage: ${0##*/} [repo's url] [directory you want to clone]"
exit
fi
local dir=${1##*/}
mkdir $dir
local tmpdir=`pwd`
@GeneralD
GeneralD / file0.txt
Last active January 7, 2018 13:03
唸れ!重装系ZSH!次世代のトレンドを体験せよ。 ref: https://qiita.com/GeneralD/items/7aad84a6560206dc6e45
export ZPLUG_HOME=/usr/local/opt/zplug
source $ZPLUG_HOME/init.zsh
@GeneralD
GeneralD / partial-search-history-with-arrow-keys.zsh
Last active March 10, 2025 13:23
Zsh partial search history
autoload -U up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search
bindkey "^[[B" down-line-or-beginning-search