Skip to content

Instantly share code, notes, and snippets.

View upinetree's full-sized avatar

Takuya Matsumoto upinetree

View GitHub Profile
out_filename_suffix = '.text'
conversions = [
{ from: ' ', to: ' ' },
{ from: /^## (.*)/, to: "\\1\n------------------------------" },
{ from: /^### /, to: '■ ' },
]
in_filename = ARGV.shift
out_filename = in_filename + out_filename_suffix
buf = ''
@upinetree
upinetree / reverse_number.rb
Created April 8, 2014 15:06
reverse_number
def reverse_number(num)
(Math.log10(num) + 1).floor.times.map{ |digit| (num/10**digit)%10 }.inject{ |sum, n| sum*10 + n }
end
reverse_number 987654321
# => 123456789
@upinetree
upinetree / gist:94913549035666e88e2a
Last active August 29, 2015 14:23
test github rdoc inline code syntax

hoge[key] hoge[k.ey]

hoge[key] hoge[k.ey]

+hoge+ +hoge+ +hoge+

# http://getbootstrap.com/migration/
patterns=(
"row-fluid"
"span[1-9]"
"offset[1-9]"
"brand"
"navbarnav"
"nav-collapse"
"btn-navbar"
@upinetree
upinetree / .gitconfig
Created May 9, 2013 03:53
git config tips
[core]
quotepath = false
excludesfile = ~/.gitignore
@upinetree
upinetree / how_to_use_knockdown.md
Last active December 18, 2015 22:39
Github Flavored Markdown on Sublime Text 2

aziz/knockdown

[https://github.com/aziz/knockdown]

なぜ

  • _の強調表示させたくない(変数名とかの見栄えが悪い)

カラースキームのデフォルトを変更する

@upinetree
upinetree / using-ruby-on-tidesdk.md
Created August 18, 2013 07:48
Ruby + TideSDKでクロスプラットフォームのデスクトップアプリを作る

Ruby + TideSDKでクロスプラットフォームのデスクトップアプリを作る

TideSDKとは

TideSDK | Create multi-platform desktop apps with HTML5, CSS3 and JavaScript

http://www.tidesdk.org

  • デスクトップアプリを作るためのツールキット
  • クロスプラットフォーム(Win, Mac, Linux)
@upinetree
upinetree / self_introduce.md
Last active December 30, 2015 00:19
自己紹介 for よちよち.rb

こんな人です

  • 松本拓也 @upinetree
  • 新潟出身。新潟歴27年
  • 転職で先月引っ越してきた
  • SI -> Web
  • 板橋区民
  • エンジニア歴2年半くらい
  • 業務アプリ(C, C++)を2年間
  • Webエンジニア2週間
  • Rails勉強中
@upinetree
upinetree / toggle_input_form.md
Created January 21, 2014 12:41
テキストをクリックして入力フォームを出現させる (rails+haml+coffee)

一覧画面とかで、表示されているテキストクリックしたら入力フォームが出現して、 サクッと内容変更できたらカッコ良いじゃないですか。

というわけで毎度のメモです。

haml

#posts
 - @posts.each do |post|
@upinetree
upinetree / capybara_find.md
Created January 21, 2014 14:07
非表示要素はCapybaraのfindで検索対象になるのか

display: noneで非表示にしてあるものはcapybaraのfind対象なのか??

という疑問があるわけです。

ここは公式みてみますか。

Module: Capybara::Node::Finders

visible (Boolean) — Only find elements that are visible on the page. Setting this to false finds invisible andvisible elements.