I hereby claim:
- I am sntran on github.
- I am sntran (https://keybase.io/sntran) on keybase.
- I have a public key ASBcUAzxTk-x6WlcKCjLyc8hYXHZpLpInPoBAEJ20Z9M-wo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
And here they are:
#!/usr/local/bin/python2.7 | |
#!/usr/local/bin/python2.7 | |
# (Minimal) Perfect Hash Functions Generator (key, value) value in this code is the key counter during reading but can be any number | |
# implementing the MOS Algorithm II CACM92 , and Amjad M Daoud Thesis 1993 at VT; | |
# based on Steve Hanof implementation http://stevehanov.ca/blog/index.php?id=119. | |
# Download as http://iswsa.acm.org/mphf/mphf.py |
%%% | |
%%% Peter Norvig's 5-card Poker hand evaluator, ported to Erlang. | |
%%% | |
-module(poker). | |
-export([hand_rank/1, sort_hands/1, winners/1]). | |
%% Return a list of the ranks, sorted with higher first. | |
%% Hand is a list of 2-char strings, i.e. ["6H","3D","AS","TH","JC"]. | |
card_ranks(Hand) -> |
Ec ido metr decilitro, iz celo semajntago via. Jh volu punktokomo ies, nk plus stil neni hop, igi in tempo renkonten komplemento. Nura nenia centimetro vir co, tc pri loka stop konsonanto, go okej' predikato por. Plena daralbajdo fi veo, povi panjo tet ok, is pli vatto komparado komplemento. Ut alial altmontaro tri, nul uj falsa nekutima.
Gv ing falsa siatempe interogativo. Mili grado monatonomo ek san, jes liternomo difiniteco substantiva as, oni pere poezio frazparto en. Tio kelke samtempe ne, nf tet vira kaŭzo, an eks liva rilativo. Ehe disde aliom gentonomo at, meze alternativa hej in, hoj ng tiuj tempopunkto memkompreneble. Pra nu hago nette, unu titolo tagnokto prepozicio ba. Ador hebrea duobla anc ha, dev bo foren grupa ometr, al ore olog geto. Ali il alio miriametro suplemento.
Hot kontraŭa malebligi ul. Dura getto infra sep ki, cent lingvonomo tutampleksa avo ve, oz plej afro ont. Hura ometr mf fin. Geedzo ipsilono bo ien. Oni krome estiel subtraho tc. Tio ne apuda subjunkcio, en multe kr
Initially, we cache only individual gist using the key {:gist, gist_id, username}
in which the first element of the tuple is the atom :gist
to act as the tag, then the gist_id
and the username
of the owner of that gist.
When fetching for gists of a particular user, we perform a match on keys with pattern {:gist, :'$1', username}
to retrieve all the cached gists by that username. All went well, or so we thought.
GitHub's API for fetching Gists will return a Link
header when there are more results than the default per_page
query, which is 30. The header has the following format when fetching gists for myself:
As developer/hacker, we are all caught up in our projects, but some times we want to write. Write about our thought process, our ideas, our instructions to do certain thing, etc...
But we don't have time to set up a blog server. Other services are there but not many of them target us, the hackers. We want something simple, with ability to embed code, and not other fancy stuffs.
So we made this. What you can do are:
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
<div class="viewport"></div> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r58/three.min.js"></script> | |
<script src="//threejs.org/examples/js/controls/OrbitControls.js"></script> |
-module(helpers). | |
is_pid_alive(Pid) when node(Pid) =:= node() -> | |
is_process_alive(Pid); | |
is_pid_alive(Pid) -> | |
lists:member(node(Pid), nodes()) andalso | |
(rpc:call(node(Pid), erlang, is_process_alive, [Pid]) =:= true). | |
get_current_time() -> | |
Now = calendar:local_time(), |
# Elixir on Erlang | |
# | |
# VERSION 0.13.2 | |
FROM sntran/kerl | |
MAINTAINER Son Tran-Nguyen "me@sntran.com" | |
RUN apt-get install -y unzip | |
RUN mkdir -p /opt/erlang/elixir | |
RUN cd /opt/erlang/elixir && curl -L -O https://github.com/elixir-lang/elixir/releases/download/v0.13.2/Precompiled.zip && unzip Precompiled.zip |