Skip to content

Instantly share code, notes, and snippets.

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

Yuki Wakayama yukiyan

🏠
Working from home
View GitHub Profile
@yukiyan
yukiyan / gist:47c185edccc9d85abb70
Created February 23, 2015 15:36
Hashのkey(String)を全てシンボルにする。
options = options.inject({}) { |accu, (key, value)| accu[key.to_sym] = value; accu }
@yukiyan
yukiyan / gist:683995a5f2f0a93bd590
Created March 17, 2015 16:27
splitして各々にヘッダ付ける
class StringEditor
def concat_header(file)
open(file, 'r+') do |f|
f.puts "header\n#{open(file).read}"
end
end
def split
system "split -a 1 -l 1 hoge.txt hogehoge_"
{
"Seti_ClosedFolder_same": true,
"Seti_SB_bright": true,
"Seti_SB_med": true,
"Seti_no_bar_undertabs": true,
"Seti_sb_small_padding": true,
"Seti_sb_tree_small": true,
"Seti_tabs_small": true,
"auto_indent": true,
"color_scheme": "Packages/Seti_UI/Scheme/Seti_monokai.tmTheme",
@yukiyan
yukiyan / gist:63f9603abe6caf4aa969
Created June 7, 2015 16:54
コミットハッシュからPR番号割り出すやつ
git log e015e8e..master --merges --ancestry-path --reverse --oneline | head -n1 | awk '{print substr($5, 2)}'
@yukiyan
yukiyan / spec_helper.rb
Created June 7, 2016 06:40
CircleCIからカバレッジ見れる
if ENV['CIRCLE_ARTIFACTS']
require 'simplecov'
dir = File.join('..', '..', '..', ENV['CIRCLE_ARTIFACTS'], 'coverage')
SimpleCov.coverage_dir(dir)
end
@yukiyan
yukiyan / Dockerfile
Created July 31, 2016 11:16
use typecast
FROM fluent/fluentd:v0.12.26-onbuild
USER root
RUN apk --update add build-base ruby-dev
USER fluent
RUN gem install \
fluent-plugin-bigquery \
fluent-plugin-typecast \
fluent-plugin-parser &&\
fluent-gem install bigdecimal
@yukiyan
yukiyan / deploy-tool.md
Last active September 22, 2016 10:05
「ECSのデプロイツールを試している話」のスライドで引用した資料のリンク
tap 'caskroom/cask'
tap 'homebrew/bundle'
tap 'homebrew/completions'
tap 'homebrew/core'
brew 'direnv'
brew 'git'
brew 'ghq'
brew 'go'
brew 'heroku'
brew 'hub'
@yukiyan
yukiyan / db_load.dig
Last active February 3, 2017 05:33
task-limit-exceeded
for_each>:
year: ["2015", "2016"]
month: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]
_do:
+monthly_repeat:
_export:
year_month: "${year}-${month}"
start_of_month: "${moment(year_month).startOf('month').format('YYYY-MM-DD')}"
end_of_month: "${moment(start_of_month).endOf('month').format('DD')}"
@yukiyan
yukiyan / karabiner.sh
Created July 14, 2016 12:34
share karabiner settings
cp ~/Library/Preferences/org.pqrs.Karabiner.plist ~/Dropbox/Apps/karabiner
cp ~/Library/Application\ Support/Karabiner/private.xml ~/Dropbox/Apps/karabiner
ln -sf ~/Dropbox/Apps/karabiner/org.pqrs.Karabiner.plist ~/Library/Preferences/org.pqrs.Karabiner.plist
ln -sf ~/Dropbox/Apps/karabiner/private.xml ~/Library/Application\ Support/Karabiner/private.xml