This file contains 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
;================================================================ | |
;auto hot key script for windows | |
;mac風キーバインド | |
;================================================================ | |
#InstallKeybdHook | |
#UseHook | |
;================================================================ | |
;関数 |
This file contains 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
#!/bin/bash -xe | |
id=`xdotool getwindowfocus` | |
xdotool key --window $id Home > /dev/null 2>&1 |
This file contains 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
class Gabagaba | |
def initialize(opts = {}) | |
opts.each do |key, value| | |
self.class.class_eval { attr_accessor "#{key}" } | |
self.instance_variable_set "@#{key}" value | |
end | |
end | |
end |
This file contains 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
(xbindkey '("m:0x4" "c:58") "/usr/local/bin/key_Return.sh") | |
(xbindkey '("m:0x4" "c:57") "/usr/local/bin/key_Down.sh") | |
(xbindkey '("m:0x4" "c:43") "/usr/local/bin/key_BackSpace.sh") | |
(xbindkey '("m:0x4" "c:33") "/usr/local/bin/key_Up.sh") | |
(xbindkey '("m:0x5" "c:41") "/usr/local/bin/key_Right.sh") | |
(xbindkey '("m:0x5" "c:56") "/usr/local/bin/key_Left.sh") |
This file contains 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
#!/bin/bash | |
base=`basename $0 | sed -e 's/\.sh$//g'` | |
cmd=`echo $base | awk -F '_' '{print $1}'` | |
keystroke=`echo $base | sed -e 's/^[^_]\+_//g'` | |
id=`xdotool getwindowfocus` | |
case $cmd in | |
key) | |
xdotool key --window $id "$keystroke" > /dev/null 2>&1 |
This file contains 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
#!/bin/bash -xe | |
base=`basename $0 | sed -e 's/\.sh$//g'` | |
cmd=`echo $base | awk -F '_' '{print $1}'` | |
keystroke=`echo $base | sed -e 's/^[^_]\+_//g'` | |
id=`xdotool getwindowfocus` | |
# Avoid chikachika-terminal | |
#app_name=`xprop -id ${id} | grep M_CLASS | cut -f3 -d ' ' | tr '[:upper:]' '[:lower:]' | tr -d ',','"',' ',"\'"` | |
#if [ "$app_name" == "terminator" ]; then |
This file contains 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 jump-to-github () | |
"Go to github code position at most recent commitl;" | |
(interactive) | |
(let (full_path) | |
(setq | |
full_path buffer-file-name | |
dir_name (shell-command-to-string (concat "echo " full_path "| xargs dirname")) | |
cd_dir (shell-command-to-string (concat "cd " dir_name)) | |
prefix (shell-command-to-string "git rev-parse --show-prefix | tr -d '\n'") | |
current_commit (shell-command-to-string "git show -s --format=%H | tr -d '\n'") |
This file contains 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
#copy from https://www.reddit.com/r/linux/comments/1pooe6/zsh_tip_notify_after_long_processes/ | |
preexec () { | |
# Note the date when the command started, in unix time. | |
CMD_START_DATE=$(date +%s) | |
# Store the command that we're running. | |
CMD_NAME=$1 | |
} | |
precmd () { | |
# Proceed only if we've ran a command in the current shell. | |
if ! [[ -z $CMD_START_DATE ]]; then |
This file contains 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
curl -LI mazgi.com -o /dev/null -w '%{http_code}\n' -s |
This file contains 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
/usr/local/bin/node /usr/local/bin/forever start \ | |
-p /var/run/forever \ | |
--pidfile /var/run/node-app.pid \ | |
-l /var/log/node-app.log -a \ | |
-d /home/node/ \ | |
/home/node/app.js |