Skip to content

Instantly share code, notes, and snippets.

View marocchino's full-sized avatar
🏠
Working from home (7am~16pm JST)

marocchino

🏠
Working from home (7am~16pm JST)
View GitHub Profile
@marocchino
marocchino / handson.jp.md
Created August 7, 2012 08:06
emberjs + rails3.2 handson
rails new ember -d postgresql
echo "gem 'emberjs-rails'" >> Gemfile
bundle
rails g scaffold todo title done:boolean
rake db:create:all
rake db:migrate
@marocchino
marocchino / design-guide.md
Created August 6, 2012 09:23
jquery mobile デサイン作業に必要な物の整理的な物

機能

これらの機能は最新版を基準に作成されております。 先ず一回VersionUpが必要かと思います。

メニュー固定表示

固定したいターグにdata-position="fixed"を書くだけでOK

<div data-role="header" data-position="fixed">
	<h1>固定表示</h1>
feature bootstrap jqury mobile sencha lungoJS
navigation O X O O
modal window O O O X
carousel O X O X
tab O O O O
accordions X X X X
async redirect X O O O
form O O O O
css customize X X X O
@marocchino
marocchino / countupTimer.js
Created July 12, 2012 17:24
print hex timestamp every 1 sec.
setInterval(function(){console.log(parseInt((new Date()).getTime()/1000).toString(16));}, 1000);
@marocchino
marocchino / syslog_rails2.rb
Created July 10, 2012 05:48
syslog rails2 log parse regex
# ref
# https://github.com/wvanbergen/request-log-analyzer/blob/master/lib/request_log_analyzer/file_format.rb
patterns = {
:completed => '(Completed in (?<duration>\d+)ms \((?:View: (?<view>\d+))?,?(?:.?DB: (?<db>\d+))?\)? \| (?<status>\d{3}).+\[(?<url>http.+)\])',
:processing => '(Processing (?<controller>(?:\w+::)*\w+)#(?<action>\w+)(?: to (?<format>\w+))? \(for (?<ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) at (?<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\) \[(?<method>[A-Z]+)\])',
:failure => '((?<error>(?:[A-Z]\w*[a-z]\w+\:\:)*[A-Z]\w*[a-z]\w+) \((?<message>.*)\)(?: on line #(?<line>\d+) of (?<file>.+))?\:\s*$)',
:cache_hit => '(Filter chain halted as \[\#<ActionController::Filters::AroundFilter.*\@method=.*(?:Caching::Actions::ActionCacheFilter|action_controller\/caching\/actions\.rb).*\] did_not_yield)',
:parameters => '(Parameters:\s+(?<parameter>\{.*\}))',
:default => '(?<message>.*)',
@marocchino
marocchino / coding_convention.md
Created June 22, 2012 01:20
코딩컨밴션 2012/07 추가분

1. 行末の空白の削除

http://rails-bestpractices.com/posts/60-remove-trailing-whitespace

"Trailing whitespace always makes noises in version control system, it is meaningless. We should remove trailing whitespace to avoid annoying other team members." 行末の空白はいつもヴァージョン管理システムで意味の無い雑音を作る。他の仲間の為に行末の空白の削除するべきだ。

でvimrcに下の奴を追加してください。

@marocchino
marocchino / sparta_vim.md
Created June 16, 2012 04:35
스파르탄 Vim
@marocchino
marocchino / gist:2787055
Created May 25, 2012 09:53
어디선가 업어온 거 'ㅅ'/
[color]
# colorの設定(以下のコマンドは自動で色つける)
status = auto
diff = auto
branch = auto
interactive = auto
grep = auto
[push]
default = tracking # defaultのpush先はtrackingしているリポジトリ
[core]
@marocchino
marocchino / rag.rb
Created May 24, 2012 05:54
me too. Ko!
12.times { |x| print (0.000393794091710758*x**11-0.0243937389770723*x**10+0.659740134479717*x**9-10.2238425925926*x**8+100.130133101852*x**7-644.502546296296*x**6+2745.28354139109*x**5-7585.58810626101*x**4+12880.0539693563*x**3-11937.1611111111*x**2+4443.37222222222*x**1+109.0).round.chr }
# language: ko
#
# 이 언어에 대해 궁금하신분은 여길 보세요: http://cukes.info/
# 元ネタ https://www.facebook.com/groups/codingeverybody/permalink/409086969131845/
기능: 심부름
아내의 말을 잘듣는 애처가로써
사랑받기 위해
심부름을 한다
시나리오: 식빵 사기(실패)