FROM clojure:latest
WORKDIR /app
EXPOSE 9000
CMD ["sh"]
version: '2'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Redis | |
redis-benchmark -t set -n 100000 -r 100000000 | |
====== SET ====== | |
100000 requests completed in 3.96 seconds | |
50 parallel clients | |
3 bytes payload | |
keep alive: 1 | |
7.07% <= 1 milliseconds | |
76.38% <= 2 milliseconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.21; | |
// This is a simple smart | |
contract Escrow { | |
mapping(address => uint256) depositorMappings; | |
mapping(address => uint256) recipientMappings; | |
mapping(address => address) depositorToRecipientMappings; | |
mapping(address => address) recipientToDepositorMappings; | |
mapping(address => uint) depositorBlockMappings; | |
uint256 constant oneDayInBlocks = 3 * 60 * 24; // around 3 blocks a minute |
I hereby claim:
- I am santosh79 on github.
- I am santosh_kumar (https://keybase.io/santosh_kumar) on keybase.
- I have a public key whose fingerprint is A96B F906 823F 22CA 63B9 CBE4 7025 A470 FFBF E06F
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule ArrayFlattener do | |
def flatten(list) do | |
flatten(list, []) |> :lists.reverse | |
end | |
def flatten([], acc) do; acc; end | |
def flatten([head|rest], acc) when is_list(head) do | |
flatten rest, flatten(head, acc) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MigratingProcesses.Manager do | |
use GenServer | |
def start_link do | |
GenServer.start_link __MODULE__, :ok, [name: :migration_manager] | |
end | |
def init(:ok) do | |
Process.flag :trap_exit, true | |
{:ok, %{}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pmap(coll, func) do | |
tasks = coll |> | |
Enum.map(fn(item) -> | |
Task.async(fn -> func.(item) end) | |
end) |> Enum.map(fn(task) -> | |
Task.await(task) | |
end) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn find-prime | |
[start end] | |
(take 1 (filter #(is-prime %) (range start end)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule SimpleDNS do | |
def start do | |
pid = spawn __MODULE__, :loop, [%{}] | |
{:ok, pid} | |
end | |
def get_entry(pid, hostname) do | |
send pid, {self(), {:get_entry, hostname}} | |
get_response pid | |
end |
NewerOlder