Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am y-matsuwitter on github.
  • I am y_matauwitter (https://keybase.io/y_matauwitter) on keybase.
  • I have a public key ASDkNDHS4KodErlKE8jfunkC1vHL_yHdQYwU8Fpp3hcQvgo

To claim this, I am signing this object:

$ go run rwmutex.go
read_start
read_start
write_start
read_start
read_complete fuga
read_complete fuga
write_complete
read_complete piyo
@y-matsuwitter
y-matsuwitter / file1.txt
Created May 4, 2014 01:41
どうしてもGoでTryCatchしたい人のためにtrycatch作った ref: http://qiita.com/y_matsuwitter/items/7f717833bc2af94bc6c7
$ go run trycatch.go
do something buggy
catch MyError
finally do something
done
@y-matsuwitter
y-matsuwitter / file0.txt
Created December 16, 2013 16:43
Goでb-bit Minwise Hashing実装した話 ref: http://qiita.com/y_matsuwitter/items/505565d1ccf403a48c77
sim(a, b) = \frac{|a \cap b|}{|a \cup b|}
@y-matsuwitter
y-matsuwitter / testflight
Created October 5, 2013 19:21
ビルドからTestflight配信までやるコマンド作った ref: http://qiita.com/y_matsuwitter/items/4fcccb3806499ff5a0be
#!/bin/sh
# applicationの名前
APP="hoge"
# SDK
SDK="iphoneos7.0"
# ビルド時の設定
CONFIGURATION="Release"
# 出力先
OUT_DIR="build"
@y-matsuwitter
y-matsuwitter / file0.rb
Created September 12, 2013 18:18
Sidekiqのconnection poolが便利かもしれない ref: http://qiita.com/y_matsuwitter/items/319e6b03625afe4dc875
class HogeWorker
REDIS_POOL = ConnectionPool.new(:size => 5, :timeout => 5) { Redis.connect}
def perform key, value
REDIS_POOL.with do |conn|
conn.set key, value
end
end
end
require 'aws-sdk'
device_token = 'your device token'
aws_access_key = 'your aws access key'
aws_secret_key = 'your aws secret key'
region = 'your aws region'
application_arn = 'your application arn'
AWS.config(
access_key_id: aws_access_key,
secret_access_key: aws_secret_key,
$ rake config
---省略---
xcode_dir : "/Applications/Xcode5-DP.app/Contents/Developer"
---省略---
@y-matsuwitter
y-matsuwitter / file0.txt
Created August 4, 2013 04:30
MongoDBをシェルで弄ることが多いならmesh使おう ref: http://qiita.com/y_matsuwitter/items/7c28aace41690cac3b88
$ git clone https://github.com/skratchdot/mesh.git
$ echo 'load("<meshをcloneしたディレクトリ>/mesh/mesh.js");' >> ~/.mongorc.js
#!/bin/sh
#
# chkconfig: 35 99 99
# description: Node.js /home/nodejs/sample/app.js
#
. /etc/rc.d/init.d/functions
USER="nodejs"