I hereby claim:
- I am bbolli on github.
- I am bbolli (https://keybase.io/bbolli) on keybase.
- I have a public key whose fingerprint is 49D5 794A EA77 F907 764F D89E 304B 93CF 506A 903A
To claim this, I am signing this object:
# debug support | |
# escape single quotes | |
SQ = '$(subst ','\'',$(1))' | |
# simple "name = value" list | |
print_vars = printf '%s\n' $(foreach v,$(sort ${.VARIABLES}),'$v = '$(call SQ,$($v))) | |
# TAB-separated list of "name origin value1 value2", where | |
# value1 is the unexpanded value, and value2 is the expanded value. |
#include <system_error> | |
#include <windows.h> | |
/// Wrap the Win32 error code so we have a distinct type. | |
struct win32_error_code | |
{ | |
explicit win32_error_code(DWORD e) noexcept : error(e) {} | |
DWORD error; | |
}; |
/* | |
* Look Ma, no macros! | |
*/ | |
/** | |
* Append the UTF-8 encoding of @a ch to @a cont. | |
*/ | |
template <class Container> | |
void to_utf8(Container& cont, wchar_t ch) | |
{ |
// Needs to be compiled with -std=c++1y for optionals support | |
#include <chrono> | |
#include <cstdio> | |
#include <cstring> | |
#include <experimental/optional> | |
#include <future> | |
#include <type_traits> | |
I hereby claim:
To claim this, I am signing this object:
"""HOTP/TOTP one time password (RFC 4226/RFC 6238) implementation""" | |
import hashlib | |
import hmac | |
import struct | |
def hotp(secret, counter, digits=6, alg=hashlib.sha1): | |
"""Calculate the HOTP value for the given secret and counter. |
def submit_to_transmission(self, enclosure): | |
"""Submit the enclosure to the Transmission RPC interface""" | |
conn = httplib.HTTPConnection('localhost:9091') | |
# the href must not be URL-encoded, or Transmission will barf | |
url = '/transmission/rpc?method=torrent-add&filename=' + enclosure.href | |
headers = {'User-Agent': 'fetcher/0.3 (+http://drbeat.li/py/)'} | |
self.log('Submitting "%s" to Transmission' % enclosure.href) | |
self.log('* Url: %s' % url, 1) | |
if self.dry_run: | |
return |