Skip to content

Instantly share code, notes, and snippets.

@saboyutaka
saboyutaka / Brewfile
Last active March 31, 2017 23:13
Brewfile
cask_args appdir: '/Applications'
tap 'caskroom/cask'
# brew 'memcached'
# brew 'mongodb'
brew 'ag'
brew 'automake'
brew 'cmake'
@saboyutaka
saboyutaka / config.py
Created September 24, 2016 11:17
Swap semicolon & colon with keyhac
import sys
import os
import datetime
import subprocess
from keyhac import *
def configure(keymap):
# Global keymap which affects any windows
keymap_global = keymap.defineWindowKeymap()
@saboyutaka
saboyutaka / better_errors.rb
Created June 9, 2016 08:40
BetterErrorsのリンクを踏むとAtomでローカルのソースファイルを開くようにする
if defined? BetterErrors
BetterErrors.editor = proc { |full_path, line|
full_path = full_path.sub(Rails.root.to_s, '/path/to/rails/root')
"atm://open?url=file://#{full_path}&line=#{line}"
}
end
@saboyutaka
saboyutaka / splanet.1m.sh
Last active April 21, 2016 08:11
Bitbarでイカリングの友人情報を表示させるアレ
#!/bin/sh
export PATH="/usr/local/bin:$PATH"
echo 'Splanet'
echo '---'
curl -s http://splapi.retrorocket.biz/gachi/now | jq -r '.result | .[] | [.rule, (.maps | join(", "))] | join(": ") + "| color=blue"'
curl -s http://splapi.retrorocket.biz/gachi/next_all | jq -r '.result | .[] | [.rule, (.maps | join(", "))] | join(": ") + "| color=blue"'
WAG_SESSION='K25YUzJVYUxXTGU2YzJaSjRpWUNuR3VzTlM4ZXZPclJvdEFjdWk0Q2RYVVZGRFNGYVdUQ1hVRkJJT0luY295UG5WUzJPLzM4QkhLZDJJN25JRWdjK3cwRjRRWHNTcUVINHhIVE5aREQ0ckNJU2JZMVVZa0NOdFFkbWFqa1MzODhFQTR5cHcvY1dMNmRCRTBZemQ0SS82bkpnQTkzK2RqSVM0dDc5anV1aVhHUHFEYjQ5RDZFMFA3eXpGNllrdFdoUlpQWU9ZdHNMNnhYbEtKN1dFN0J6QUF5VzRvbUNpSVRIaFlFQStuYWhqcko5V0ZHc1BPTjVRTUJjcEY1SFVGcDMzeURieHJoOXhQQzJSTWZyQ0xxY2U2cG1rNzBaYW9KZjZaMkJTemZYUnVONmRsTEY1RUlsdlkvTVJtVnpack5uanJEVm9HRG5BU1VYaXZIUUVtcjkyZXMyYUtjeUtjOCtkenNjTzIrQkx4NUpmMjc1NjRDSEJqcDZodWNmOFV5LS1vdHVVTHA1TkRoU2d5QnZOeDFhVUNRPT0%3D--7bd8f9569ddf68feb80eb726197c9c8534e795b7'
curl -s 'https://splatoon.nintendo.net/friend_list/index.json' -H "Cook
@saboyutaka
saboyutaka / .rubocop.yml
Last active January 5, 2016 09:36
rubocop.yml inspired by onkcop
inherit_gem:
onkcop: 'config/rubocop.yml'
# target_version:
# rubocop v0.35.1
# 自動生成されるものはチェック対象から除外する
AllCops:
Include:
- '**/Rakefile'
@saboyutaka
saboyutaka / trello_wider.js
Created October 17, 2015 06:24
Trello wider
javascript:var width = "900px";Array.prototype.forEach.call(document.querySelectorAll(".list-card"), function(node) {node.style.maxWidth = width});Array.prototype.forEach.call(document.querySelectorAll(".list-wrapper"), function(node) {node.style.width = width});
@saboyutaka
saboyutaka / build_dev_env.sh
Created October 12, 2015 06:52
How build development environment for Mac
# Install Homebrew (skip if it's already installed)
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
# Install rbenv(if you use zsh, replace .bash_profile with .zprofile)
brew install rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
brew install ruby-build
brew install rbenv-gemset
@saboyutaka
saboyutaka / symbolic_link.sh
Last active October 10, 2015 05:40
symbolic_link.sh
@saboyutaka
saboyutaka / save_image.rb
Created March 3, 2015 00:53
画像保存スクリプト
def save_image(url)
# ready filepath
fileName = File.basename(url)
dirName = "/var/tmp/hoge/"
filePath = dirName + fileName
# create folder if not exist
FileUtils.mkdir_p(dirName) unless FileTest.exist?(dirName)
# write image adata
@saboyutaka
saboyutaka / kana01.rb
Last active August 29, 2015 14:13
kana01 ペアプロ
input = [
# [ id, input, expected ],
[ 0, "4*5+6&7|8", "44" ],
[ 1, "15*5", "75" ],
[ 2, "15+5", "20" ],
[ 3, "15&5", "5" ],
[ 4, "15|5", "15" ],
[ 5, "30*15*5", "2250" ],
[ 6, "30*15+5", "600" ],
[ 7, "30*15&5", "150" ],