Skip to content

Instantly share code, notes, and snippets.

View motemen's full-sized avatar
🌴
On vacation

Hironao OTSUBO motemen

🌴
On vacation
View GitHub Profile

Keybase proof

I hereby claim:

  • I am motemen on github.
  • I am motemen (https://keybase.io/motemen) on keybase.
  • I have a public key ASDeHHENut6BNMrzADz6dXaYftc5XUhB5yIOdvWit1aVvgo

To claim this, I am signing this object:

- ー
~ ~
: ー
; っ
a あ
ba ば
bd べん
be べ
bh ぶう
bi び
@motemen
motemen / gorun.sh
Created March 9, 2018 05:17
Shell script to run a Go program by package path
#!/bin/bash
set -e
pkg="$1"; shift
files=($(go list -f '{{range .GoFiles}}{{$.Dir}}/{{.}}{{end}}' "$pkg"))
go run -exec "bash -c 'shift; exec \"\$0\" \"\$@\"'" "${files[@]}" -- "$@"
@motemen
motemen / test.pl
Last active November 11, 2016 06:34
$] = 5.008008
$URI::VERSION = 1.71
https://www.example.com?hoge=%E3%81%BB%E3%81%92
https://www.example.com?hoge=%C3%A3%C2%81%C2%BB%C3%A3%C2%81%C2%92&foo=bar
use strict;
use warnings;
use HTTP::Tiny;
use JSON;
use App::cpanminus::fatscript;
my $dist = shift;
my $dep = shift;
my $version = shift;
sig Person {
shaken: set Person,
partner: Person
}
fact partnerProperties {
partner = ~partner
no p: Person | p in p.partner
}
http://api.metacpan.org/v0/release/_search?source={%20%22query%22:%20{%20%22filtered%22:%20{%20%22query%22:%20{%20%22match_all%22:%20{}%20},%20%22filter%22:%20{%20%22and%22:%20[%20{%20%22term%22:%20{%20%22distribution%22:%20%22Net-CIDR-MobileJP%22%20}%20},%20{%20%22nested%22:%20{%20%22path%22:%20%22dependency%22,%20%22filter%22:%20{%20%22and%22:%20[%20{%20%22term%22:%20{%20%22dependency.module%22:%20%22WWW::MobileCarrierJP%22%20}%20},%20{%20%22term%22:%20{%20%22dependency.version_numified%22:%200%20}%20}%20]%20}%20}%20}%20]%20}%20}%20}%20}
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);
#!/usr/bin/env ruby
# textlint-asciidoctor -r ./macro.rb -T code,dfn index.adoc
require 'asciidoctor'
require 'cgi'
require 'json'
require 'optparse'
require 'tempfile'
ERASED_TEXT = '◆◆'
An example simple repository.