Skip to content

Instantly share code, notes, and snippets.

View munky69rock's full-sized avatar
:octocat:
Colla(コラ) というサービスを開発してます

Masayuki Uehara munky69rock

:octocat:
Colla(コラ) というサービスを開発してます
View GitHub Profile
@munky69rock
munky69rock / html2haml.sh
Last active December 12, 2015 00:09
convert html to haml
#!/bin/sh
# http://html2haml.heroku.com/
set -ue
if [ $# -ne 1 -o ! -e "$1" ]; then
echo "Usage: $0 [path] ";
exit
fi
@munky69rock
munky69rock / perldoc.sh
Created February 22, 2013 03:25
perldocをutf-8にして出力させる
#!/bin/sh
SHELL=/bin/bash /usr/bin/perldoc -n 'nkf -w | nroff' "$@"
@munky69rock
munky69rock / 2013-02-22.md
Last active December 14, 2015 02:08
2013/02/22

今週のTips

  • shellで演算する

      echo $((3600*24*3)) # -> 259200
    
  • 実機でJSデバッグする

漢のJavaScript (サーバーサイド編)

@munky69rock
munky69rock / get_cpu_core_num.sh
Created June 7, 2013 09:27
CPUコア数の取得
#!/bin/sh
# cf:http://www.songmu.jp/riji/archives/2013/06/worker.html
getconf _NPROCESSORS_ONLN
#!/bin/sh
pbpaste | sort | uniq | pbcopy
@munky69rock
munky69rock / langton_ant.haml
Last active December 23, 2015 06:09
Langton's Ant
!!! 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
#
#!/bin/bash
set -ue
target_dir="__TARGET_DIR__"
backup_dir="__BACKUP_DIR__"
date=$(date +%Y%m%d)
idx=0
@munky69rock
munky69rock / setup_dti_iptables.sh
Last active August 29, 2015 13:56
simple iptables settings for DTI ServerMans@VPS
#!/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
#!/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
@munky69rock
munky69rock / responsive-background-image.css
Created July 4, 2014 16:58
Responsive Full Background Image Using CSS
/* 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;
}