Notes / examples from Programming Erlang with emphasis on Riak
Page | Code | Method | Source |
---|
import datetime | |
from riak.client import RiakClient | |
epoch = datetime.datetime.utcfromtimestamp(0) | |
def unix_time_millis(dt): | |
td = dt - epoch | |
return int(td.total_seconds() * 1000.0) | |
tenMins = datetime.timedelta(0, 600) |
I hereby claim:
To claim this, I am signing this object:
public interface IYoMamaService
{
bool IsSoFat { get; }
}
public interface IYoMamaServiceConfig
{
int SoFatSize { get; }
}
#!/usr/bin/env bash | |
RBENV_ROOT="$HOME/.rbenv" | |
if [[ -d "$RBENV_ROOT/bin" ]] | |
then | |
export RBENV_ROOT | |
export PATH="$HOME/.rbenv/bin:$PATH" | |
eval "$(rbenv init -)" | |
else | |
echo "Expected to find rbenv in $RBENV_ROOT!" 2>&1 |
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb | |
index 8c04cb5..132d803 100644 | |
--- a/ext/openssl/extconf.rb | |
+++ b/ext/openssl/extconf.rb | |
@@ -104,6 +104,9 @@ | |
have_func("SSLv2_method") | |
have_func("SSLv2_server_method") | |
have_func("SSLv2_client_method") | |
+have_func("SSLv3_method") | |
+have_func("SSLv3_server_method") |
global | |
log /dev/log local0 info | |
pidfile /home/lbakken/run/haproxy.pid | |
defaults | |
log global | |
timeout connect 1s | |
timeout client 50ms | |
timeout server 1s |
#!/usr/bin/env bash | |
set -o errexit | |
set -o nounset | |
# This script needs mp3splt, cdrtools, vorbis-tools | |
CREATE_OGG="false"; | |
CREATE_FLAC="true"; | |
CREATE_MKA="false"; |
What could go wrong here?
receiver() ->
receive
{first, Msg} ->
io:format("receiver first ~s~n", [Msg]),
receive
{second, Msg} ->
io:format("receiver second ~s~n", [Msg]);
# rabbitMQ password hashing algo as laid out in: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2011-May/012765.html | |
from __future__ import print_function | |
import base64 | |
import os | |
import hashlib | |
import struct | |
# This is the password we wish to encode | |
password = 'simon' |