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
;;; hx-golang.el --- Utils works with Golang | |
;;; Commentary: | |
;;; Code: | |
(defcustom hx-golang-build-flags "-gcflags='-l -N' -tags debug" | |
"Flags for build golang packages." | |
:type 'string | |
:options '(turn-on-auto-fill) |
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
on run {input, parameters} | |
set my_file to first item of input | |
set dir_path to quoted form of (POSIX path of my_file) | |
tell application "iTerm" | |
set newWindow to (create window with default profile) | |
tell current session of newWindow | |
write text "cd " & dir_path | |
end tell | |
end tell | |
end run |
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 | |
read -r -d '' script <<'EOF' | |
on run argv | |
tell application "iTerm" | |
activate | |
set newWindow to (create window with default profile) | |
tell current session of newWindow | |
set args to "" | |
repeat with arg in argv |
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/sh | |
/usr/bin/open -a /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app |
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 | |
showAll=`defaults read com.apple.finder AppleShowAllFiles` | |
if [[ "$showAll" = "NO" ]]; then | |
defaults write com.apple.finder AppleShowAllFiles YES | |
else | |
defaults write com.apple.finder AppleShowAllFiles NO | |
fi | |
killall Finder /System/Library/CoreServices/Finder.app |
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
# run command "crontab -e" to edit crontab | |
# require pidof utils install in /usr/local/bin | |
* * * * * bash -c "[ -z \"`/usr/local/bin/pidof Spectacle`'\" ] && open -a Spectacle" |
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 | |
# you can setup crontab to run this script periodically | |
# require pidof install in /usr/local/bin | |
# read config from ~/.bgapp | |
ret=0 | |
while read s; do | |
IFS="|"; cfg=($s) ; unset IFS; | |
if [ "${#cfg[@]}" = "2" ]; then | |
if [ -z "`/usr/local/bin/pidof ${cfg[0]}`" ]; 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
;;; hx-xcode --- Utils work with Xcode. | |
;;; Commentary: | |
;; This is free and unencumbered software released into the public domain. | |
;; Anyone is free to copy, modify, publish, use, compile, sell, or | |
;; distribute this software, either in source code form or as a compiled | |
;; binary, for any purpose, commercial or non-commercial, and by any | |
;; means. |
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
# θ§ι’ζεΎηζδ»Άη¨ζζζ₯ζζ₯ε½ε | |
# εΎηζΉε | |
exiv2 rename -F *.jpg | |
# εΎηιε½ζΉε | |
find . -name "*" -type f -exec bash -c 'exiv2 rename -r %Y%m%d-$(basename $(dirname $0))-%H%M%S -F $0' {} \; | |
# θ§ι’ιε½ζΉε | |
find . -iname "*.mov" -exec bash -c 'echo mv $0 $(dirname $0)/$(exiftool -s2 -d %Y%m%d-%H%M%S -createdate $0 | awk -F " " "{print \$2}").mov' {} \; |