Skip to content

Instantly share code, notes, and snippets.

View manaten's full-sized avatar
🐢
I'm LAZY monster

manaten manaten

🐢
I'm LAZY monster
View GitHub Profile
<?php
preg_match('/^[0-9]+$/', $hoge);
preg_match('/^[a-zA-Z0-9_\-]+$/', $hoge);
@manaten
manaten / gist:7a7d9c5cc843f1dbf31b
Last active August 29, 2015 14:03
HubotにQRコード作らせる
# Description:
# Show qr-code.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
mkdir test_repo
cd test_repo
git init
touch test.txt
git add .
git commit -m 'initial commit'
echo hoge >> test.txt
git add .
git commit -m 'second commit'
git log
@manaten
manaten / gist:2c2df56accfe590df215
Last active August 29, 2015 14:10
hubot で configで指定している以外のチャンネルでhearした場合につぶやかないスクリプト。最初に読まれるように _ とかでファイル名を始める
# Description:
# Force hubot hearing messages only in rooms.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
@manaten
manaten / gist:22b5793ccc0660f96dba
Created December 9, 2014 03:51
全てのメッセージにアイコンを付けるスクリプト
#
# Description:
# Add hubot icon to bot message.
#
# Dependencies:
# None
#
# Configuration:
# None
#
me = new MutualExclusion;
var hogeProcess = function(args, done) {
me.do(function(done) {
someAsync(function(err, result) {
done(err, result);
});
}, done);
}
express = require 'express'
request = require 'request'
app = express()
app.get '/', (req, res) -> res.send 'test!!!'
mockHttpServer = app.listen 3011, ->
request 'http://localhost:3011', (err, res, body) ->
console.log body
mockHttpServer.close()
@manaten
manaten / ghe-event.coffee
Created February 17, 2015 08:51
gheのissuecommentを各人にslackDMで通知
#
# Description:
# Watch and emit github events.
# see https://developer.github.com/v3/activity/events/types/
#
# Dependencies:
# cron, request, config, lodash
#
# Configuration:
# config.github.organizations 監視したいgheのorg名をキーとするオブジェクト
alert('こんにちはこんにちは!');
@manaten
manaten / fizzbuzz.js
Last active December 16, 2015 05:39
FizzBuzz
for(i=21;--i;)console.log(i%3?i:"Fizz",i%5?i:"Buzz")