Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Hironao OTSUBO motemen

🌴
On vacation
Block or report user

Report or block motemen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View want-kill-tree.js
var spawn = require('child_process').spawn;
var depth = process.argv[2];
if (!depth) {
var p = spawn('node', [ process.argv[1], '1' ], { stdio: 'inherit' });
setTimeout(() => {
console.log(process.pid, 'Killing child', p.pid);
p.kill();
}, 500);
View README.txt
An example simple repository.
View ghq.sbt
lazy val ghqGetDepndencies = taskKey[Unit]("""Download dependencies using "ghq get".""")
ghqGetDepndencies <<= (ivyPaths, libraryDependencies, streams) map {
(ivyPaths, libraryDependencies, s) =>
new IvyCache(ivyPaths.ivyHome).withDefaultCache(None, s.log) {
cache =>
libraryDependencies.foreach {
m =>
import org.apache.ivy.core.module.id.ModuleRevisionId
import scala.collection.JavaConversions._
View github-webhook-pullrequest.json
{
"action": "synchronize",
"number": 2,
"pull_request": {
"url": "https://api.github.com/repos/motemen/test-repository/pulls/2",
"id": 17160832,
"html_url": "https://github.com/motemen/test-repository/pull/2",
"diff_url": "https://github.com/motemen/test-repository/pull/2.diff",
"patch_url": "https://github.com/motemen/test-repository/pull/2.patch",
"issue_url": "https://api.github.com/repos/motemen/test-repository/issues/2",
View global.sbt
watchSources ~= {
_.filterNot {
f =>
f.isDirectory ||
"""^\..*\.sw.$""".r.findFirstIn(f.getName).isDefined
}
}
lazy val ghqGetDepndencies = TaskKey[Unit]("ghq-get-dependencies")
View amazon-gather-order-history.js
var BASE_URL = 'https://www.amazon.co.jp/gp/css/order-history';
var Gatherer = (function () {
function Gatherer() {
this.year = new Date().getFullYear();
this.page = 1;
this.result = [];
}
Gatherer.prototype.start = function () {
var d = $.Deferred();
@motemen
motemen / CartonPacker.pm
Created Oct 29, 2013
while ! carton exec perl -MCartonPacker foo.pl do; sleep 3; done
View CartonPacker.pm
package CartonPacker;
use strict;
use warnings;
use Config;
BEGIN {
# as lib::core::only
@INC = @Config{qw(privlibexp archlibexp)};
}
@motemen
motemen / 01_ex.rb
Last active Dec 24, 2015
SimpleCov and multiple loads
View 01_ex.rb
if $flag
p :true
else
p :false
end
View 20130925_184043.ruby_-e_3.times____i__p_i__sleep_1____abort__bye_.log
User: motemen
Host: dominica.local
Date: 2013年 9月25日 水曜日 18時40分43秒 JST
Directory: /Users/motemen/work/op
Git-Revision: 568cc195834d2bc6a94dfe5e69620d92433e1dfa (master)
% ruby -e 3.times { |i| p i; sleep 1 }; abort 'bye'
[Wed Sep 25 18:40:44 2013] OUT 0
[Wed Sep 25 18:40:45 2013] OUT 1
[Wed Sep 25 18:40:46 2013] OUT 2
@motemen
motemen / dic
Created Aug 21, 2013
look up Dictionary.app from console
View dic
#!/bin/sh
open dict://"$*"
You can’t perform that action at this time.