Skip to content

Instantly share code, notes, and snippets.

View peco8's full-sized avatar
💭
Where's my Boy Bawang?

Toshiki Inami peco8

💭
Where's my Boy Bawang?
  • Rakuten, Inc
  • Tokyo
View GitHub Profile
@peco8
peco8 / implicit_conversion.rb
Last active September 11, 2016 10:35
# 2 Use built-in conversion protocols
winners = [
'HomeStar',
'King of town',
'Marzipan',
'Strongpad'
]
Place = Struct.new(:index, :name, :prize)
first = Place.new(0, 'first', 'Peasants quest game')
@peco8
peco8 / benchmark.rb
Created August 11, 2016 12:47
benchmark
class ProgrammerProvicer
PROGRAMMERS = [
{
name: 'tanaka',
skills: ['Java','Oracle', 'HTML']
},
{
name: 'toshiki',
skills: ['C','Ruby', 'php']
},
@peco8
peco8 / aasm-1.rb
Created August 10, 2016 05:02
AASM basic
class Plan < ActiveRecord::Base
include AASM
aasm column: 'state' do
state :pending, initial: true
state :processing
state :finished
state :errored
event :process, after: Proc.new { start } do
@peco8
peco8 / tsn.srt
Created April 2, 2016 12:35 — forked from shelling/tsn.srt
The Social Network subtitle
1
00:00:04,829 --> 00:00:09,829
Credit to: Sakti Tandi [1st Indonesian-Script]
English. Subs. and. Re-Sync. by npdv-iD
2
00:00:19,043 --> 00:00:21,168
You know there are more people
with genius IQ living in China
@peco8
peco8 / Vagrantfile
Created February 9, 2016 07:36 — forked from leifg/Vagrantfile
Add a second disk to system using vagrant
file_to_disk = './tmp/large_disk.vdi'
Vagrant::Config.run do |config|
config.vm.box = 'base'
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024]
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end
@peco8
peco8 / .emacs
Created February 1, 2016 06:28 — forked from ftrain/.emacs
a nice .emacs for when you are on a terminal. Respects scroll wheel events. Very useful when run inside of tmux and combined with this tmuxconf: https://gist.github.com/ftrain/8443744
;; .emacs
;;; uncomment this line to disable loading of "default.el" at startup
;; (setq inhibit-default-init t)
;; enable visual feedback on selections
(setq transient-mark-mode t)
;; default to better frame titles
(setq frame-title-format
@peco8
peco8 / file_finder.sh
Created December 13, 2015 12:18
Find file in current directory recursively, and print lines which match PATTERN.
#!/bin/bash
usage()
{
# Fetch the shell script name
local script_name=$(basename "$0")
# Show help
cat << END
@peco8
peco8 / README.md
Created December 13, 2015 10:01
This is tree-ish contents listing script, which outputs the contents recursively.

keep_listing.sh

What is this?

This is tree-ish contents listing script, which outputs the contents recursively.

How to use it?

keep_listing.sh $path

@peco8
peco8 / 000-Cheat-Sheets.md
Created December 12, 2015 05:46 — forked from JoshuaEstes/000-Cheat-Sheets.md
Developer Cheat Sheets for bash, git, gpg, irssi, mutt, tmux, and vim. See my dotfiles repository for extra info.
@peco8
peco8 / nginx_try_files_memo.md
Created November 19, 2015 07:23 — forked from kenjiskywalker/nginx_try_files_memo.md
nginxのtry_filesの動作の確認

nginx config

nginx.conf

server {
    listen 80;
    server_name example.com;
    root /var/www/html/;
    index index.html;
    access_log /var/log/nginx/access_log hogehoge;