Skip to content

Instantly share code, notes, and snippets.

@saboyutaka
saboyutaka / development.md
Last active August 29, 2015 13:56
Development Environment in Rails.

Development Environment in Rails.

@saboyutaka

BOOTHで使ってるツールを紹介。

pry

  • $ (show-source)
  • ? (show-doc)
  • history --grep
  • .
@saboyutaka
saboyutaka / idobata_debug.coffee
Created April 16, 2014 11:20
idobata_debug.coffee
util = require 'util'
module.exports = (robot) ->
robot.respond /debug( snippet)?/, (msg) ->
if msg.match[1]?
msg.send '```\n' + util.inspect(msg) + '\n```'
else
msg.send util.inspect msg
@saboyutaka
saboyutaka / booth_link.coffee
Created April 16, 2014 11:22
booth_link.coffee
@saboyutaka
saboyutaka / git_aliases
Last active August 29, 2015 14:00
ぼくのさいきょうのgit alias
# most useful aliases
alias ga='git add'
alias gb='git branch'
alias gc='git checkout'
alias gg=display_git_branch_and_wip_files
alias gcm='gc master'
alias gd='git diff'
alias gdc='git diff --cached'
alias gpoc='git push origin `gitcurrentbranch`'
alias gwip='git commit -m '\''WIP'\'
@saboyutaka
saboyutaka / replay_github_webhook_idobata.coffee
Last active August 29, 2015 14:00
GitHub webhookが出力するログをidobataで特定のroomで再度mentionする。
module.exports = (robot) ->
robot.hear /.*/, (msg) ->
if process.env.HUBOT_IDOBATA_GITHUB_MENTION_ROOM and
process.env.HUBOT_GITHUB_REPO and
msg.message.user.name is 'GitHub' and
!/@/.test(msg.message.text)
msg.message.data.room_id = process.env.HUBOT_IDOBATA_GITHUB_MENTION_ROOM
repo = process.env.HUBOT_GITHUB_REPO
language: ruby
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=1
- PLAZA_DBUSER=travis
rvm: 2.1.0
services:
- mysql
bundler_args: --without development moxy
cache: bundler
https://idobata.io/organizations/terakoya4/rooms/sabo-team/join_request/7893076c-e10b-4642-9961-bfb538386677
@saboyutaka
saboyutaka / new_issues_on_github.coffee
Created June 27, 2014 09:48
新しく作られたissueをidobata-hubotで表示するスクリプト
require 'date-utils'
_ = require 'lodash'
github = require 'githubot'
getSince = ->
date = Date.today()
if date.getDay() is 1
date.addDays -3 # since Friday if today is Monday
else
date.addDays -1
@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" ],
@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