Skip to content

Instantly share code, notes, and snippets.

@adwhit
adwhit / gist:5007a304d68891ead581e4c9035db205
Created November 16, 2016 17:55
Nameko - Kombu 4.0.0 error
$ nameko run publisher
starting services: service_b, service_a
Connected to amqp://guest:**@127.0.0.1:5672//
Traceback (most recent call last):
File "/home/alex/.virtualenvs/nameko/lib/python3.5/site-packages/eventlet/hubs/poll.py", line 115, in wait
listener.cb(fileno)
File "/home/alex/.virtualenvs/nameko/lib/python3.5/site-packages/eventlet/greenthread.py", line 214, in main
result = function(*args, **kwargs)
File "/home/alex/.virtualenvs/nameko/lib/python3.5/site-packages/nameko/utils.py", line 176, in call
return getattr(item, name)(*args, **kwargs)
@adwhit
adwhit / Main.hs
Last active March 3, 2021 10:20
Haskell Tic-Tac-Toe with Minimax
module Main where
import Data.List ( sort, sortBy )
import Data.Ord (comparing)
import Data.Maybe
import Control.Monad (msum)
import System.IO
import System.Random
import Options.Applicative
@adwhit
adwhit / dynamic.rs
Created June 10, 2016 15:48
Typed linked lists in Rust
use std::fmt::Display;
// Our stack-allocated, typed, linked list
struct TypedLinkedList<E, R> where E: MyTrait, R: Traverse {
value: E,
rest: R,
}
// Denotes the end of the list
@adwhit
adwhit / gist:9083572
Created February 19, 2014 00:25
Boggle SERSPATGLINESERS solution
#!/usr/bin/python
from collections import defaultdict
board = list("SERSPATGLINESERS".lower())
with open("word.list") as f:
allowed = set(word.strip().lower() for word in f)
interim = set()
for word in allowed: