Skip to content

Instantly share code, notes, and snippets.

View suisho's full-sized avatar
🚫
Deprecated

Old account suisho

🚫
Deprecated
View GitHub Profile
@suisho
suisho / load-script-recursive.coffee
Created February 20, 2013 16:13
Load hubot script recursive directory
# Description:
# Load script recursively
# Dependences:
# "glob": "~3.1.20"
Path = require "path"
Glob = require "glob"
module.exports = (robot) ->
robot.logger.info "read sub dir"
dirs = Glob.sync(__dirname+"/**/*/")
@suisho
suisho / DependsOnPlatform.java
Created December 15, 2012 14:20
get annotation on junit setup
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface DependsOnPlatform {
public String value();
}
@suisho
suisho / TsvOutputFormat.java
Created August 16, 2012 05:34
Output extension ".tsv" for Hadoop
import java.io.DataOutputStream;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.io.compress.CompressionCodec;
@suisho
suisho / Gruntfile.coffee
Last active December 21, 2015 03:19
いつも使うgrunt
module.exports = (grunt) ->
require('load-grunt-tasks')(grunt)
grunt.initConfig
jade:
compile:
files: [
expand : true,
src : [
'jade/**/*.jade'
class C {
def call(num:Int):Unit = {
}
}
class X {
type Hoge = { def call(num:Int):Unit;}
def exe(hoge:Hoge, num:Int) = {
hoge.call(num)
}
#!/bin/bash
# This is the current stable release to default to, with Omnibus patch level (e.g. 10.12.0-1)
# Note that the chef template downloads 'x.y.z' not 'x.y.z-r' which should be a duplicate of the latest -r
use_shell=0
prerelease="false"
# Check whether a command exists - returns 0 if it does, 1 if it does not
exists() {
@suisho
suisho / chromerty.js
Created May 20, 2013 14:10
node-chromeを縮小したサンプル書きかけ
var defaultPath = function(){
}
var spawn = require('child_process').spawn;
var http = require('http');
var url = require('url');
var fs = require('fs');
var path = require('path');
package main
import (
"fmt"
"math"
)
func newton(x, z float64) float64{
@suisho
suisho / zaraki.coffee
Created March 7, 2013 11:27
hubotに即死魔法をかける
module.exports = (robot) ->
robot.respond /ザラキ/ ,(msg)->
msg.send robot.name+" は しんでしまった"
process.nextTick () ->
throw new Error "!!! Thwack !!!"
var async = require('async');
var util = require("util")
// execute multi query
module.exports = function(connection, queries, options, cb){
if(typeof options === "function") cb = options, options = {};
if(!options) options = {};
if(typeof queries == "string"){
queries = [queries];
}