Skip to content

Instantly share code, notes, and snippets.

View akm's full-sized avatar

Takeshi Akima akm

View GitHub Profile
@akm
akm / file0.txt
Created June 16, 2014 10:31
Mavericksでerlang R15B01をインストールする方法 ref: http://qiita.com/akm/items/bf14253a27943b13e79b
kerl build R15B01 r15b01-01
@akm
akm / file0.txt
Created June 30, 2014 15:00
7つのデータベース7つの世界 第3章Riak2日目のハマりどころ ref: http://qiita.com/akm/items/d33472936f6fccf6b26b
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.9.3
BuildVersion: 13D65
-module(recursive).
-export([split/2]).
-export([fib/1]).
split(D, L) -> split(D, L, [], []).
split(_, [] , R, W) -> [lists:reverse(X) || X <- lists:reverse([W|R])];
split(D, [D|T], R, W) -> split(D, T, [W|R], []);
split(D, [H|T], R, W) -> split(D, T, R, [H|W]).
fib(0) -> 0;
@akm
akm / sq_escape.rb
Created February 27, 2015 07:44
single quote escape for bash
def sq_escape(str)
str.split(/\'/).map{|s| "'#{s}'"}.join("\\'")
end
sq_escape {"breakfast"=>"Bill's"}.to_json
#=> "'{\"breakfast\":\"Bill'\\''s\"}'"
puts sq_escape {"breakfast"=>"Bill's"}.to_json
#=> '{"breakfast":"Bill'\''s"}'
# # on bash
# $ echo '{"breakfast":"Bill'\''s"}'
@akm
akm / remote_manifesto.ja.text
Last active August 29, 2015 14:18
The Remote Manifesto (ja)
The original is https://about.gitlab.com/2015/04/08/the-remote-manifesto/
We all have been greatly helped by Scrum and the Agile manifesto.
It freed us from waterfall planning and excessive process. But working
remotely and continuous delivery need something more.
私達は皆Scrumとアジャイルマニフェストに救われてきました。
それはウォーターフォールの計画ややり過ぎたのプロセスから私達を開放してくれました。
しかし、リモートでの働き方や継続的デリバリにはまだ何か必要なのです。
require 'logger'
require 'github_api'
require 'active_support/core_ext/object'
class IssueApi
attr_accessor :org, :repo
attr_reader :logger
def initialize
@akm
akm / file0.txt
Last active November 19, 2015 04:23
hbase shellからexportする方法 ref: http://qiita.com/akm/items/84d918270f158a144c2f
hbase(main):041:0* org.apache.hadoop.hbase.mapreduce.Export.main(["foo", "/tmp/foo.dump"])
2015-11-19 03:28:11,249 INFO [main] Configuration.deprecation: session.id is deprecated. Instead, use dfs.metrics.session-id
(snip)
2015-11-19 03:16:44,307 INFO [main] mapreduce.Job: Job job_local2087152213_0001 completed successfully
2015-11-19 03:16:44,327 INFO [main] mapreduce.Job: Counters: 18
File System Counters
FILE: Number of bytes read=74629416
FILE: Number of bytes written=843785016
FILE: Number of read operations=0
FILE: Number of large read operations=0
@akm
akm / file0.txt
Last active December 8, 2015 05:55
JRubyの多次元配列をjavaの多次元配列に変換する方法 ref: http://qiita.com/akm/items/40d3f69960d99746d450
irb(main):034:0> [[1,2,3]].to_java(Java::byte[])
=> [B[[B@436a4e4b]@f2f2cc1
irb(main):035:0> [[[1,2,3]]].to_java(Java::byte[][])
=> [[B[[[B@3b2cf7ab]@2aa5fe93
#!/usr/bin/env ruby
# https://developer.github.com/v3/auth/#working-with-two-factor-authentication
# https://developer.github.com/v3/orgs/teams/
require 'json'
require 'httpclient'
class GithubRepoMatrix
@akm
akm / gist:eb02445ccc051844ef66
Created March 11, 2016 02:28 — forked from billsinc/gist:1157544
Remove Firebird DB from MacOS
#!/bin/sh
echo "Clean Services"
echo "Clean User"
dscl localhost -delete /Local/Default/Users/firebird
echo "Clean Group"
dscl localhost -delete /Local/Default/Groups/firebird
if [ -f "/Library/StartupItems/Firebird" ]; then
echo "Remove SuperServer StartupItem"
rm -fr /Library/StartupItems/Firebird
fi