I hereby claim:
- I am bunker-inspector on github.
- I am tedgkassen (https://keybase.io/tedgkassen) on keybase.
- I have a public key ASDcAhBl8Wj7lkmSzvm9A4aWL3xvVfVKbRNisLRKduI-ygo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
package mugman | |
import ( | |
"bytes" | |
"fmt" | |
slackbot "github.com/BeepBoopHQ/go-slackbot" | |
"github.com/nlopes/slack" | |
"math/rand" | |
"strings" | |
"time" |
package twitter | |
import ( | |
"github.com/BurntSushi/toml" | |
"os" | |
"fmt" | |
"sync" | |
"bufio" | |
"net/http" | |
"io/ioutil" |
import sys | |
import imageio | |
from datetime import datetime | |
def gen_map(blots, rows, cols, normal): | |
grid = [[255] * cols for _ in range(rows)] | |
def blot_and_bleed(blot, grid, rows, cols, normal): | |
row,col,dark = blot |
class Trie: | |
def __init__(self): | |
self.prefix_tree = {} | |
def add(self, new_word): | |
curr_pfxs = self.prefix_tree | |
for char in new_word: | |
if char not in curr_pfxs: | |
curr_pfxs[char] = {} |
(def input '((1 4 5 9 9 9 9 9 9) | |
(1 3 4 12 13) | |
(2 6) | |
(58))) | |
(defn- list->indexed-map | |
[ls] | |
(->> ls | |
(map-indexed (fn [idx ls*] [idx ls*])) | |
(into {}))) |
defmodule EctoEncoder do | |
def encode(struct, opts \\ []) do | |
struct | |
|> Map.from_struct | |
|> (fn x -> if opts[:take] !== nil, do: Map.take(x, opts[:take]), else: x end).() | |
|> Map.drop([:__meta__|(opts[:drop] || [])]) | |
|> Enum.reduce(%{}, fn | |
{_, %Ecto.Association.NotLoaded{}}, acc -> acc | |
{key, value}, acc -> Map.put(acc, key, value) | |
end) |