-
shellで演算する
echo $((3600*24*3)) # -> 259200
-
実機でJSデバッグする
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 | |
# http://html2haml.heroku.com/ | |
set -ue | |
if [ $# -ne 1 -o ! -e "$1" ]; then | |
echo "Usage: $0 [path] "; | |
exit | |
fi |
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 | |
SHELL=/bin/bash /usr/bin/perldoc -n 'nkf -w | nroff' "$@" |
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 | |
# cf:http://www.songmu.jp/riji/archives/2013/06/worker.html | |
getconf _NPROCESSORS_ONLN |
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 | |
pbpaste | sort | uniq | pbcopy |
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
!!! 5 | |
%meta(charset="utf-8") | |
%title Langton's Ant | |
:coffeescript | |
# | |
# original: http://ottati.hatenablog.com/entry/2013/09/16/122423 | |
# rewrite and customize with haml & coffee-script | |
# demo: http://jsdo.it/munky69rock/a3Zl | |
# |
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 | |
set -ue | |
target_dir="__TARGET_DIR__" | |
backup_dir="__BACKUP_DIR__" | |
date=$(date +%Y%m%d) | |
idx=0 |
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 | |
# http://www.creativegear.jp/2011/03/29/dti-serversmanvps/ | |
iptables -F | |
iptables -X | |
# http | |
iptables -A INPUT -p tcp --dport 80 -j ACCEPT |
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 | |
if [ $# -gt 0 ];then | |
find . -type f -name "*jar" -exec bash -c "echo {}: >&2 && unzip -l {}" \; | grep $1 --color | |
else | |
echo "Usage: $0 [classname]" | |
fi |
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
/* http://coliss.com/articles/build-websites/operation/css/css-responsive-full-background-image-by-sixrevisions.html */ | |
/* http://sixrevisions.com/css/responsive-background-image/ */ | |
body { | |
background: url(background-photo.jpg) center center cover no-repeat fixed; | |
} |