This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const title: string = '今日の夕ご飯を決めるガチャ' | |
console.log(title) | |
console.log('--------------------------') | |
const menu: string[] = ['野菜を鍋にする', 'ラーメンをゆでる', 'baseの麺']; | |
menu.push('出前館 肉') | |
menu.push('出前館 麺') | |
menu.push('出前館 ピザ') | |
menu.push('baseのパン') | |
menu.push('ファミレスにいく') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# date.to_s #=> "2018年4月1日(日)" | |
Time::DATE_FORMATS[:default] = ->(t) { | |
t.strftime("%Y年%-m月%-d日(#{I18n.t('date.abbr_day_names')[t.wday]})") | |
} | |
# date.to_s(:datetime) #=> "2018年4月1日(日) 9:05" | |
Time::DATE_FORMATS[:datetime] = ->(t) { | |
t.strftime("%Y年%-m月%-d日(#{I18n.t('date.abbr_day_names')[t.wday]}) %-H:%M") | |
} | |
# date.to_s(:datetime_without_week) #=> "2018年4月1日 9:05" | |
Time::DATE_FORMATS[:datetime_without_week] = "%Y年%-m月%-d日 %-H:%M" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 全角数字を半角数字に変更 | |
// -> 半角数字以外を除去 | |
// -> xxx-xxxxの形に変更 | |
function fixPostalCode(postal_code) { | |
const fixed = postal_code | |
.replace(/[0-9]/g, function(s) { | |
return String.fromCharCode(s.charCodeAt(0) - 65248); | |
}) | |
.replace(/[^0-9]/g, '') | |
.replace(/^([0-9]{3})([0-9]{0,4}).*/, "$1-$2"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if &compatible | |
set nocompatible " Be iMproved | |
endif | |
" Required: | |
set runtimepath+=/home/vagrant/.vim/bundles/./repos/github.com/Shougo/dein.vim | |
" Required: | |
if dein#load_state('/home/vagrant/.vim/bundles/.') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
現在地がわからなくなっているらしい | |
git status | |
=> index small | |
rm .git/index | |
git status | |
# | |
# Initial commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// thにスクロールバー分の幅を持たせる | |
$(document).on('turbolinks:load', function(){ | |
var outer = window.outerWidth; | |
var inner = window.innerWidth; | |
var scroll = outer - inner; | |
$("thead tr").attr("style", "padding-right: "+ scroll +"px"); | |
} | |
); |