View file0.js
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
AWS = require('aws-sdk') | |
AWS.config.region = 'ap-northeast-1' | |
sns = new AWS.SNS() | |
platformApplicationArn = 'arn:aws:sns:ap-northeast-1:xxx:xxx' | |
module.exports = (robot) -> | |
Date::format = -> | |
"#{@.getFullYear()}#{@.getMonth() + 1}#{@.getDate()}#{@.getHours()}#{@.getMinutes()}#{@.getSeconds()}" | |
subscribe = (topicArn, endpointArn) -> |
View file0.txt
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 'paperclip/helpers' | |
Paperclip::Helpers.module_eval do | |
def run(cmd, arguments = "", interpolation_values = {}, local_options = {}) | |
command_path = options[:command_path] | |
Cocaine::CommandLine.path = [Cocaine::CommandLine.path, command_path].flatten.compact.uniq | |
if logging? && (options[:log_command] || local_options[:log_command]) | |
local_options = local_options.merge(:logger => logger) | |
end | |
Cocaine::CommandLine.new("#{Rails.env.production? ? 'ionice -c3 -n7 ' : ''}nice -n19 #{cmd}", arguments, local_options).run(interpolation_values) | |
end |
View file0.txt
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
sudo yum install golang git mercurial |
View gist:d063a7652daab64f3080
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
1月 2015 | |
日 月 火 水 木 金 土 | |
1 2 3 | |
4 5 6 7 8 9 10 | |
11 12 13 14 15 16 17 | |
18 19 20 21 22 23 24 | |
25 26 27 28 29 30 31 | |
今日が1/17なので | |
19,20,21,22,23,26,27,28,29,30 あたりで都合がいい日 |
View file0.txt
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
Spree::Admin::OptionTypesController.class_eval do | |
def update | |
Spree::OptionType.skip_callback(:touch, :after, :touch_all_products) | |
super | |
end | |
end |
View file0.txt
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 'thor' | |
require 'celluloid' | |
include Celluloid::Logger | |
Celluloid.logger = ::Logger.new("sample.log") | |
class SampleThor < Thor | |
desc "test", "sample" | |
def test | |
error "test" | |
end |
View file0.txt
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
npm install node-trello --save | |
npm install octonode --save |
View file0.coffee
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
robot.router.post "/google/drive/notifications", (req, res) -> | |
robot.logger.debug req | |
# 何かしらの処理 | |
res.status(200).send 'ok' |
View file0.txt
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
heroku addons:create mongolab:sandbox |
View file0.coffee
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.exports = (robot) -> | |
sleep = (ms) -> | |
start = new Date().getTime() | |
continue while new Date().getTime() - start < ms | |
robot.on 'my:sleep', (ms) -> | |
sleep ms |
OlderNewer