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
Last active April 26, 2016 09:13
複数のSubversionのリポジトリを一つのGitリポジトリに移行する方法 ref: http://qiita.com/akm/items/0ec3929f9abdbdcab1cb
$ git svn clone svn+ssh://host/path/to/repo1
@akm
akm / file0.txt
Created March 25, 2016 02:29
環境変数など任意のオブジェクトをキーでソートしたオブジェクトを取得する ref: http://qiita.com/akm/items/1278af3873aa589da154
var obj = { ... }
Object.keys(obj).sort().reduce(function(d, k){ d[k] = obj[k]; return d;}, {})
@akm
akm / file0.txt
Last active March 15, 2016 13:58
El Capitanでv8-315を使ってtherubyracerをインストールする方法 ref: http://qiita.com/akm/items/02c104fc3d39d68f96c7
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
@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
#!/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 / 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
@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
require 'logger'
require 'github_api'
require 'active_support/core_ext/object'
class IssueApi
attr_accessor :org, :repo
attr_reader :logger
def initialize
@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とアジャイルマニフェストに救われてきました。
それはウォーターフォールの計画ややり過ぎたのプロセスから私達を開放してくれました。
しかし、リモートでの働き方や継続的デリバリにはまだ何か必要なのです。
@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"}'