Skip to content

Instantly share code, notes, and snippets.

$ g diff Gemfile.lock
diff --git a/Gemfile.lock b/Gemfile.lock
index f0ba45c..dfe4057 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -133,6 +133,35 @@ GEM
jbuilder (2.2.5)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
+ jpmobile (4.1.4)
@tanaka51
tanaka51 / application_helper.rb
Last active August 29, 2015 14:10
i wanna do json_for
module ApplicationHelper
# http://railscasts.com/episodes/409-active-model-serializers?view=asciicast
# `json_for` method described at above page doesnt work for AMS 9.0...
def json_for(target)
serializer = ActiveModel::Serializer.serializer_for(target)
if serializer.class == ActiveModel::ArraySerializer
serializer.new(
target,
each_serializer: ActiveModel::Serializer.serializer_for(target.first)
@tanaka51
tanaka51 / .zshrc
Created September 23, 2014 02:17
zshrc
export LANG=ja_JP.UTF-8
export EDITOR=vim
export TERM='screen-256color'
HISTFILE=$HOME/.zsh-history
HISTSIZE=100000
SAVEHIST=100000
bindkey -e
@tanaka51
tanaka51 / .tmux.conf
Created September 23, 2014 02:16
tmux.conf
# mode
set -g mode-keys vi
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
# default shell
set -g default-shell /usr/local/bin/zsh
# prefix
set -g prefix C-z
@tanaka51
tanaka51 / set_authorized_keys.sh
Last active August 29, 2015 14:01
set everyleaf members public kyes to ~/.ssh/authorized_keys
#! /bin/sh
users=(nay kuko den8 tatsuo hassaku ksbmyk kyuden n-sakuma publichtml redfit upinetree yakitorii yorimitsu yoshihara tanaka51-jp uu59)
for user in ${users[@]}; do
echo Set $user public keyes...
curl -s https://github.com/$user.keys >> ~/.ssh/authorized_keys
done
@tanaka51
tanaka51 / vimrc
Last active December 31, 2015 14:38
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'altercation/vim-colors-solarized'
Plugin 'bronson/vim-trailing-whitespace'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'tacahiroy/ctrlp-funky'
@tanaka51
tanaka51 / main.go
Last active December 26, 2015 05:29
share a variable between some goroutines
package main
import (
"fmt"
"math/rand"
"sync"
"time"
)
const (
@tanaka51
tanaka51 / mugicha.el
Last active December 22, 2015 10:28
Emacs meets tmux!
;;; mugicha.el --- Emacs meets tmux!
;; Author: Koichi TANAKA <tanaka51.jp@gmail.com>
;; This file is *NOT* part of GNU Emacs.
;;; Code:
(eval-when-compile (require 'cl))
(defgroup mugicha nil
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x0000000101585181, pid=636, tid=3871
#
# JRE version: 7.0_25-b15
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.25-b01 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V [libjvm.dylib+0x2a7181]
#
@tanaka51
tanaka51 / find-cp
Created June 21, 2013 09:34
find-cp png jpg -o ~/path/to/directory
#!/usr/bin/env ruby
require 'fileutils'; include FileUtils
require 'optparse'
dest_path = ""
noop = ""
opt = OptionParser.new
opt.on('-o VAL') {|v| dest_path = v }
opt.on('-d', '--dry-run') {|v| noop = v }