Skip to content

Instantly share code, notes, and snippets.

// C++11 style observer pattern implementation using lambda for scoped
// connection management.
//
// Copyright (c) 2012 Nick C.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
#ifndef TAINTCXX_H
#define TAINTCXX_H
namespace taint {
template<typename X> class tainted {
private:
X m_x;
public:
tainted(X const & x) : m_x(x) {}
tainted(X && x) : m_x(x) {}
import my.component
import pytest
import asyncio
class multisend:
def __init__(self, loop):
self.loop = loop
self.output_ready = loop.create_future()
self.output = []
from typing import Optional
class WordList:
words: list[str]
last: Optional[str]
mask: list[str]
known: set[str]
wrong: set[str]
blocked: list[set[str]]
@dwd
dwd / whatnwords.py
Created July 7, 2022 17:04
Encode lat/long using interleaved base32/NATO progressive representation
# Copyright 2022 Dave Cridland
# Licensed under MIT
import sys
lat, long = [float(n) for n in sys.argv[1:3]]
LIMIT = 2 ** 20
SHIFT = 6
@dwd
dwd / CLA.md
Last active January 13, 2024 17:48 — forked from pjcozzi/CLA.md
CLA

By making a contribution to this project, I certify that:

(1) I understand and acknowledge the licence under which this project is available at the time of the contribution ("the upstream licence").

(2) I understand and agree all contributions can only be accepted (and therefore must only be offered) under terms which allow the resultant work to continue to be available under the upstream licence ("compatible terms").