This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /usr/bin/env bash | |
export PATH=$HOME/.rbenv/versions/2.3.0-dev/bin/:$PATH | |
export RUBYLIB=$HOME/.rbenv/versions/2.3.0-dev/lib | |
rbenv install -f 2.3.0-dev | |
cd $HOME/rake | |
git pull --rebase origin master | |
rake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -n "$DEBUG" ]; then | |
exec coffee --nodejs --debug node_modules/.bin/hubot "$@" | |
else | |
exec node_modules/.bin/hubot -a slack "$@" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: | |
# airbrake | |
HUBOT_AIRBRAKE_KEY=process.env.HUBOT_AIRBRAKE_KEY | |
module.exports = (robot) -> | |
robot.router.post "/hubot/airbrake/:room", (req, res) -> | |
data = { project_id: req.body.error.project.id, notice_id: req.body.error.last_notice.id, group_id: req.body.error.id } | |
robot.brain.set('airbrake', data) | |
res.end "Done" | |
robot.respond /a(?:irbrake)? last( \| (general|backtrace|params|env|session|context))?/i, (msg) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: | |
# spike | |
module.exports = (robot) -> | |
robot.router.get "/hubot/spike/:room", (req, res) -> | |
robot.brain.set('spike', req.params.room) | |
res.end "Done" | |
robot.respond /spike/i, (msg) -> | |
msg.send robot.brain.get('spike') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module KPI | |
module Summary | |
class SalesReport | |
def client | |
@client ||= Mysql2::Client.new( | |
host: Settings.kpi.database.host, | |
database: Settings.kpi.database.xxxxxxx, | |
username: config['username'], | |
password: config['password'] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ADD_RANGE_1 = (-1.50..-0.50) | |
ADD_RANGE_2 = (0.50..3.50) | |
ADD_STEP = 0.25 | |
ADD_VALUES = (ADD_RANGE_1.step(ADD_STEP).to_a + ADD_RANGE_2.step(ADD_STEP).to_a).freeze |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/constraints.rb | |
class Home | |
def matches?(req) | |
req.params[:id] #=> nil | |
# ..... | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 前略 | |
env: | |
- "DB=mysql NUM_GROUPS=10 GROUP=1,2" | |
- "DB=mysql NUM_GROUPS=10 GROUP=3,4" | |
- "DB=mysql NUM_GROUPS=10 GROUP=5,6" | |
- "DB=mysql NUM_GROUPS=10 GROUP=7,8" | |
- "DB=mysql NUM_GROUPS=10 GROUP=9,10" | |
before_install: gem install bundler --pre | |
before_script: | |
# 中略 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/setup' | |
Bundler.require | |
class Price | |
attr_reader :including_tax | |
def initialize(including_tax) | |
@including_tax = including_tax | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"net/http" | |
"strings" | |
"time" | |
"log" | |
) |