Skip to content

Instantly share code, notes, and snippets.

全体

Let this long package float, 
Goto private class if short.
While protected with debugger case,  
Continue volatile interface.
Instanceof super synchronized throw, 
Extends final export throws.  
@3100
3100 / sample.lua
Last active August 29, 2015 14:01
turtle.forward()
tenkiのpref番号
1,2,3,4 hokkaido
5 aomori
6 iwate
7 miyagi
8 akita
9 yamagata
10 fukusgima
11 ibaraki
12 tochigi
@3100
3100 / yukkuri.coffee
Last active August 29, 2015 13:59
a hubot script which proxies our inner service
module.exports = (robot) ->
robot.respond /yukkuri (\S+)/i, (msg) ->
url = "http://xxxx.t.proxylocal.com/#{encodeURIComponent(msg.match[1])}"
getResult(msg, url)
getResult = (msg, url) ->
msg.http(url).get() (err, res, body) ->
if err
msg.send "something went wrong."
else
@3100
3100 / update_b2d.sh
Created April 12, 2014 12:26
Update boot2docker
#!/bin/sh
TARGET=boot2docker
if [ ! -e $TARGET ]; then
rm $TARGET
fi
curl https://raw.github.com/boot2docker/boot2docker/master/boot2docker > $TARGET
chmod +x $TARGET
@3100
3100 / DryRunner.java
Last active December 14, 2015 11:29
a class reflection sample in Java.
public class DryRunner extends RunnerBase {
public DryRunner(String file) {
super(file);
}
public Boolean delete()
{
log("dry:delete.");
return true;
}
@3100
3100 / remove_spam_account.sh
Created February 8, 2013 04:52
Remove spam accounts from your MoinMoin.
#!/bin/bash
WHITELIST=./whitelist
WHITEUSER_FILES=$(cat $WHITELIST)
for USER_FILE in `ls *.*.*`
do
PATTERN=''
for ITEM in $WHITEUSER_FILES
do
if [ ${#PATTERN} -gt 0 ] ; then
@3100
3100 / pull_hubot_scripts.sh
Last active December 12, 2015 06:28
Pull hubot-scripts from remote repos. Install expect if you don't have. You need to init <SCRIPT_PATH> with git and add remote origin.
#!/bin/sh
SCRIPT_PATH="/your/hubot/node_modules/hubot-scripts"
PASSPHRASE="hoo"
cd $SCRIPT_PATH
expect -c "
spawn git pull origin master
expect Enter ; send \"$PASSPHRASE\n\"
interact
@3100
3100 / reboot_hubot.sh
Last active December 12, 2015 06:19
Reboot hubot. This script helps you to reboot hubot by hubot script with child_process.
#!/bin/bash
HUBOT_DIR="/your/hubot/home"
HUBOT_BIN="bin/hubot"
HUBOT_RC=".hubotrc"
HUBOT_OPTION="-n / -a hubot-adapter"
HUBOT_LOG="hubot.log"
cd $HUBOT_DIR
TEXT=`ps a | grep $HUBOT_BIN | head -n 1|`
@3100
3100 / sort_as.js
Last active December 11, 2015 06:58
a Greasemonkey script file to sort rooms of AsakusaSatellite's main page in date order.
// ==UserScript==
// @name sort_as
// @namespace 3100
// @description ASのルームを更新順序順に変更する
// @include http://as.iplwiki.info/
// @version 1.0.2
// ==/UserScript==
(function (){
var changeTextForSort = function(text) {
var date_str_arr = text.split(' '); //cf. ["2013-01-28","12:58","pm"]