Skip to content

Instantly share code, notes, and snippets.

View sakahukamaki's full-sized avatar

sakahukamaki sakahukamaki

  • 路地ラボ
  • Shimane -> Osaka -> Tottori
View GitHub Profile
const title: string = '今日の夕ご飯を決めるガチャ'
console.log(title)
console.log('--------------------------')
const menu: string[] = ['野菜を鍋にする', 'ラーメンをゆでる', 'baseの麺'];
menu.push('出前館 肉')
menu.push('出前館 麺')
menu.push('出前館 ピザ')
menu.push('baseのパン')
menu.push('ファミレスにいく')
@sakahukamaki
sakahukamaki / datetime_format.rb
Created September 20, 2018 07:58
weekが付いてくる前提
# 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"
@sakahukamaki
sakahukamaki / format_postalcode.js
Created May 8, 2018 13:47
郵便番号を入力されたらもろもろ整形してハイフン含む形に成型する
// 全角数字を半角数字に変更
// -> 半角数字以外を除去
// -> 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");
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/.')
現在地がわからなくなっているらしい
git status
=> index small
rm .git/index
git status
#
# Initial commit
// 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");
}
);