Skip to content

Instantly share code, notes, and snippets.

View bouzuya's full-sized avatar

bouzuya bouzuya

View GitHub Profile
@bouzuya
bouzuya / upload.js
Created May 20, 2014 21:51
Amazon S3 upload
var Promise = require('q').Promise;
var fs = require('fs');
var path = require('path');
var S3 = require('aws-sdk').S3;
var readFile = function(file, options) {
var opts = (options || {}).text ? { encoding: 'utf-8' } : {};
return fs.readFileSync(file, opts);
};
{Promise} = require 'q'
{Robot, TextMessage} = require 'hubot'
class RobotDriver
TIMEOUT = 100 # ms
constructor: ->
@robot = null # initialize in start()
@adapter = null # initialize in start()
@started = false
@bouzuya
bouzuya / hubot-scripts.md
Created September 6, 2014 14:59
hubot scripts
yyyy-mm-dd js gif name url
2014-07-14 [ ] [ ] hubot-gengo https://github.com/bouzuya/hubot-gengo
2014-07-15 [ ] [ ] hubot-lgtm https://github.com/bouzuya/hubot-lgtm
2014-07-16 [ ] [ ] hubot-retweet https://github.com/bouzuya/hubot-retweet
2014-07-17 [ ] [x] hubot-merge-pr https://github.com/bouzuya/hubot-merge-pr
2014-07-18 [ ] [ ] hubot-omikuji https://github.com/bouzuya/hubot-omikuji
2014-07-19 [ ] [ ] hubot-tweet https://github.com/bouzuya/hubot-tweet
2014-07-20 [ ] [ ] hubot-fav https://github.com/bouzuya/hubot-fav
@bouzuya
bouzuya / untitled
Created September 6, 2014 15:04
bash for loop
for repo in $(cat <<EOT
hoge
fuga
piyo
EOT)
do
echo 'command'
done
// Description:
// Hello
// Commands:
// hubot hello - say hello!
module.exports = function(robot) {
robot.respond(/hello/i, function(res) {
res.send('Hello, Gist!');
});
};
# Description:
# Hello
# Commands:
# hubot hello - say hello!
module.exports = (robot) ->
robot.respond /hi/i, (res) ->
res.send 'Hi, Gist!'
@bouzuya
bouzuya / index.md
Created September 25, 2014 14:28
2014-09-25 gistlog

gist で blog って書けないのだろうか

@bouzuya
bouzuya / index.md
Created September 26, 2014 04:47
2014-09-26 blog の要件

blog が blog であるために必要なものは何だろう。

とりあえず条件をあげてみよう。

  • article を見られる。
  • article の一覧を見られる。
  • それぞれの article が permalink を持つ。
  • それぞれの article が tags を持つ。
  • それぞれの article が pubdate を持つ。
  • article の関連する article を見られる。
{
"name": "blog.bouzuya.net@gist",
"description": "bouzuya's weblog using gist"
}
@bouzuya
bouzuya / index.md
Created September 27, 2014 21:49
2014-09-27 hubot-gistlog-create をとりあえず

hubot-gistlog-create をとりあえずつくった。

Shell Adapter だと改行を入れられないし、チャットで使うとなると個人別に設定できないので、実用性は微妙。

ローカルで Hubot を動かすための環境を整備したい。