Skip to content

Instantly share code, notes, and snippets.

Avatar

Katsumata Ryo katsumata-ryo

View GitHub Profile
View jpy_comma.rb
class Integer
def jpy_comma
self.to_s.gsub(/(\d)(?=(\d{3})+(?!\d))/, '\1,')
end
end
@katsumata-ryo
katsumata-ryo / gist:d94b4fe3be8053ad8599
Last active Aug 29, 2015
mklink for java config(apache directory studio )
View gist:d94b4fe3be8053ad8599
# windows install java. for slink(mklink) memo
# launch admin permission.
mklink /D "新しく作りたいシンボリックリンクのフルパス" "リンクさせたいディレクトリのフルパス"
@katsumata-ryo
katsumata-ryo / sublime_user_setting.json
Last active Jan 25, 2016
Sublime Text 3 - Settings User
View sublime_user_setting.json
{
// encoding & line ending
"default_encoding": "UTF-8",
"fallback_encoding": "UTF-8",
"default_line_ending": "unix",
"show_encoding": true,
"show_line_endings": true,
// UI
"caret_style": "smooth",
@katsumata-ryo
katsumata-ryo / .vimrc
Last active Aug 29, 2015
.vimrcテンプレート
View .vimrc
" color scheme
" get => https://raw.githubusercontent.com/tomasr/molokai/master/colors/molokai.vim
" change : ctermfg=222 => ctermfg=227
colorscheme molokai
syntax on
let g:molokai_original = 1
let g:rehash256 = 1
set background=dark
set t_Co=256
View .bashrc
# LANG=C
export LANG=C
# sshkey read.
sshaddl=`ssh-add -L`
username = `uname -n`
case $sshaddl in
"The agent has no identities.")
ssh-add /Users/$username/.ssh/id_rsa ;;
@katsumata-ryo
katsumata-ryo / gist:4e7c1a2b1f3c1df7059b
Last active Dec 14, 2015 — forked from machida/html_practice.html
HTMLの練習(このレシピにマークアップをしてみましょう)
View gist:4e7c1a2b1f3c1df7059b
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>カレーのレシピ</title>
</head>
<body>
<article>
<header>
<h1>カレーのレシピ</h1>
View .gitconfig
[user]
name = name
email = name@example.com
[alias]
log = log --graph --date=short
pr = pull-request -b develop
unstage = reset -q HEAD --
amend = commit --amend
uncommit = reset --mixed HEAD~
discard = checkout --
View gist_test.rb
def say_hello(name)
puts "Hello, #{name}"
end
say_hello('ryo')
View gist:463d5333c1e6c89e3cdee13a869b82bb
$ rails new <NAME>
### Gemfile のアップデート
# Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
View gist:b5b1a05dddda42e95f2104d3773310ac
$ rails generate sorcery:install
Running via Spring preloader in process 29650
create config/initializers/sorcery.rb
gsub config/initializers/sorcery.rb
generate model User --skip-migration
Running via Spring preloader in process 29679
invoke active_record
create app/models/user.rb
invoke test_unit
create test/models/user_test.rb