Skip to content

Instantly share code, notes, and snippets.

@saboyutaka
saboyutaka / development.md
Last active Aug 29, 2015
Development Environment in Rails.
View development.md

Development Environment in Rails.

@saboyutaka

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

pry

  • $ (show-source)
  • ? (show-doc)
  • history --grep
  • .
View booth_link.coffee
View 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 / git_aliases
Last active Aug 29, 2015
ぼくのさいきょうのgit alias
View git_aliases
# 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 Aug 29, 2015
GitHub webhookが出力するログをidobataで特定のroomで再度mentionする。
View replay_github_webhook_idobata.coffee
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
View .travis.yml
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
View gist:69e28ad6d9c9bd2ec815
https://idobata.io/organizations/terakoya4/rooms/sabo-team/join_request/7893076c-e10b-4642-9961-bfb538386677
@saboyutaka
saboyutaka / new_issues_on_github.coffee
Created Jun 27, 2014
新しく作られたissueをidobata-hubotで表示するスクリプト
View new_issues_on_github.coffee
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 Aug 29, 2015
kana01 ペアプロ
View kana01.rb
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 Mar 3, 2015
画像保存スクリプト
View save_image.rb
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
You can’t perform that action at this time.