Skip to content

Instantly share code, notes, and snippets.

Yuki Ito mururu

Block or report user

Report or block mururu

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 shared_libs.sh
for p in $(ps -aux | grep -v grep | awk {'print $2'}); do
x=$(ls -l "/proc/${p}/exe")
if [ $?=0 ]; then
y=$(echo $x | awk {'print $11'})
echo $y
ldd $y
fi
done
View 無題.md

ちょっと前の話ですが、トレジャーデータという会社を辞めました。えぐいほどいい会社だし、全世界のIoTデータをさばくやつを作るのは技術者として死ぬほど楽しいんだろうなと思ったけど、僕はあるスタートアップに行くことにしました。

カンムという会社です。よろしくお願いします。

@mururu
mururu / ca_cowboy_middleware.erl
Last active Mar 28, 2018 — forked from sebmaynard/ca_cowboy_middleware.erl
[For Cowboy 2.0] A Cowboy middleware to set some CORS headers for every request, and to handle OPTIONS requests without needing to implement them in every handler.
View ca_cowboy_middleware.erl
-module(ca_cowboy_middleware).
-behaviour(cowboy_middleware).
-export([execute/2]).
execute(Req, Env) ->
{ok, ReqWithCorsHeaders} = set_cors_headers(Req),
Method = cowboy_req:method(ReqWithCorsHeaders),
View fifocache.erl
-module(fifocache).
-export([new/1, push/3, lookup/2]).
%%-----------------------------------------
%% FIFO cache
%%
%% - Representation
%%
%% {Map, Array, Size, Bottom, Top, NewFlag}
@mururu
mururu / RESULTS.md
Created Nov 10, 2015
Micro benchmark of EVP for AES-CTR in Erlang/OTP
View RESULTS.md

no-EVP

1> c(bench3).
{ok,bench3}
2> bench3:run().
encrypt: 65230 times/sec
decrypt: 67715 times/sec
ok
View CHECKED_PLUGINS.md

Checked plugins

built-in

  • in_debug_agent

  • in_dummy

  • in_exec

View diff.patch
diff --git ebin/rebar.app ebin/rebar.app
index 710f8b2..b683ffb 100644
--- ebin/rebar.app
+++ ebin/rebar.app
@@ -46,7 +46,8 @@
rebar_metacmds,
rebar_getopt,
rebar_mustache,
- rmemo ]},
+ rmemo,
@mururu
mururu / extract_public_key.erl
Created Jun 25, 2015
extract_public_key.erl
View extract_public_key.erl
-include_lib("public_key/include/public_key.hrl").
extract_public_key(CertPath)
{ok, CertBinary} = file:read_file(CertPath),
CertPemEntries = public_key:pem_decode(CertBinary),
{'Certificate', Cert, _} = lists:keyfind('Certificate', 1, CertPemEntries),
#'OTPCertificate'{
tbsCertificate = #'OTPTBSCertificate'{
subjectPublicKeyInfo = #'OTPSubjectPublicKeyInfo'{
subjectPublicKey = PublicKey
@mururu
mururu / otp.md
Last active Aug 29, 2015
shinjuku.ex #10 発表資料
View otp.md

Elixir ユーザーのための OTP 入門 (Shinjuku.ex #10)

話すこと

  • OTP とは何か
  • 「よくわからないけど使ったほうがいいっぽい」から「なぜ使うのかを意識して使う」になるための導入(になるといいな)
  • 詳細な API とかには触れません

だれ?

View string_io.ex
defmodule StringIO do
def new(string) when is_binary(string) do
spawn_link(fn -> string_io_process(string) end)
end
def string_io_process(string) do
loop(:infinity, String.to_char_list!(string))
end
def loop(wait, buf) do
You can’t perform that action at this time.