Skip to content

Instantly share code, notes, and snippets.

View kaosf's full-sized avatar
🏠
Working from home

ka kaosf

🏠
Working from home
View GitHub Profile
@kaosf
kaosf / a.sh
Created February 10, 2013 17:41
string comparation
#! /bin/bash
# if [ $1 = '' ]; then
# if [ -n $1 ]; then
if [ -n "$1" ]; then
echo 'arg1 length > 0'
else
echo 'arg1 length = 0'
fi
@kaosf
kaosf / build.sh
Created March 14, 2013 10:50
tiapp.xml を切り替えるシェルスクリプト書いたし ref: http://qiita.com/items/a2c57d2e3b216033ad8b
#! /bin/sh
./tiapp_xml-converter $1
ti build # ここは各自でちゃんと書いてね
./tiapp_xml-reverter
@kaosf
kaosf / json-parser-wity-ruby.sh
Last active December 15, 2015 13:39
oneliner JSON parser with Ruby
# cat a.json # => {"x": "a", "y": 1, "z": true}
cat a.json | ruby -rjson -e "puts JSON.parse(STDIN.read)" # => {"x"=>"a", "y"=>1, "z"=>true}
# ruby -v #=> ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-linux]
# on Ubuntu 12.04
@kaosf
kaosf / .mayu
Created March 29, 2013 04:42
窓使いの憂鬱設定ファイル (.mayu)
#### 全体的なキーボード配置変更 ################################################
include "109.mayu"
include "104on109.mayu"
keymap Global
def subst *英数 = *英数
mod control += 英数
key *英数 = *LeftControl
def subst *変換 = *変換
key S-C-Space = $ToggleIME
@kaosf
kaosf / .mayu
Created March 29, 2013 04:43
yamy 設定ファイル
include "109.mayu"
include "104on109.mayu"
# def subst *RightSquareBracket = *Enter
def subst *YenSign = *BackSpace
def subst *E0英数 = *E0英数 # 104on109 内の設定を無効化
mod control += E0英数
key *E0英数 = *LControl
!!!
/[if lt IE 7] <html class="no-js lt-ie9 lt-ie8 lt-ie7">
/[if IE 7] <html class="no-js lt-ie9 lt-ie8">
/[if IE 8] <html class="no-js lt-ie9">
/[if gt IE 8] <!--> <html class="no-js"> <!--
%head
%meta{:charset => "utf-8"}
%meta{:content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}
%title
%meta{:content => "", :name => "description"}
@kaosf
kaosf / install-homebrew.sh
Created April 27, 2013 02:34
Install homebrew to local
echo 'export PATH=$HOME/local/bin:$PATH' >> $HOME/.zshenv # or .bashrc
exec $SHELL
mkdir -p $HOME/local/bin
cd $HOME/local/bin
git clone https://github.com/mxcl/homebrew --depth 1
ln -s $HOME/local/bin/homebrew/bin/brew
!!! 5
//if lt IE 7
<html class="no-js lt-ie9 lt-ie8 lt-ie7">
//if IE 7
<html class="no-js lt-ie9 lt-ie8">
//if IE 8
<html class="no-js lt-ie9">
//[if gt IE 8]><!
html(class='no-js')
//<![endif]
@kaosf
kaosf / a.sh
Created June 28, 2013 08:46
そのシェルスクリプトのあるディレクトリに移動する ref: http://qiita.com/ka_/items/6e4d1ff9800937a6bd8c
#! /bin/bash
THIS_FILE_PATH="$PWD/$0"
cd ${THIS_FILE_PATH%/*}
@kaosf
kaosf / file0.txt
Created June 28, 2013 11:12
ShellScript でもテストを書こう with shUnit2 ref: http://qiita.com/ka_/items/1271df92c95e5d8084c2
APP_ROOT
|- a.sh
`- test/
|- run.sh
|- a.txt
|- a-expected.txt
`- shunit2