Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am moreati on github.
  • I am moreati (https://keybase.io/moreati) on keybase.
  • I have a public key whose fingerprint is C9CD 3335 C138 7291 2022 F30D 2E51 C57B 5A6F 95BE

To claim this, I am signing this object:

Verifying I am +moreati on my passcard. https://onename.com/moreati
Verifying I am +moreati on my passcard. https://onename.com/moreati
@moreati
moreati / example.rst
Last active October 14, 2015 16:27
How to have hidden setup code for doctests

This code is executed, but not rendered

This code is both executed by doctest and rendered in the output document

>>> datetime.datetime.fromtimestamp(0)
@moreati
moreati / bytes2dots.py
Created October 20, 2015 14:44
A way to visualize byte strings, by (ab)using the 256 braille characters in Unicode 3.0
#!/usr/bin/env python3
UNICODE_BRAILLE_BASE = 0x2800
def int2bits(v):
"""
>>> int2bits(25)
[0, 0, 0, 1, 1, 0, 0, 1]
"""
assert 0 <= v <= 255
@moreati
moreati / gist:2d3a55b42294b95c6e45
Last active November 15, 2015 22:15
A silly micro-benchmark of PPeg 0.9.4
alex@martha:~/src/ppeg $ python playpen/f.py
subj length loops re regex ppeg
1 1000000 295.5n 397.3n 311.4n
2 500000 316.8n 481.8n 344.2n
3 333333 340.3n 555.4n 356.7n
4 250000 361.6n 636.0n 385.4n
5 200000 388.5n 726.9n 462.2n
6 166666 410.0n 787.5n 483.9n
7 142857 451.9n 861.5n 513.3n
8 125000 488.6n 962.4n 536.9n
@moreati
moreati / everykey-q-and-a.md
Created February 6, 2016 12:23
Some Q & A regarding EveryKey

Some Q & A regarding EveryKey.

Reformatted from the comments section of EveryKey's project on Indigogo. Questions were asked by Stephanie Bouniol (a backer), and answered by Daniel Thomas (a campaigner) in in early January 2016.

  1. is there a way to keep some short PINs or full password in addition to everykey (multifactor) at least for some entries? (like my online banking)

Multifactor authentication is not something that we have planned for the initial release of the Everykey application and browser extensions, but it is something we are looking to add to a later release.

  1. why can’t I store the passwords simply on my PC or android devices instead of a cloud?
#!/usr/bin/env python3
from __future__ import print_function
import sys
if sys.version_info[0] < 3:
raise RuntimeError("This program requires Python 3.x")
# or to avoid having a traceback:
#print("This program requires Python 3.x", file=sys.stderr)
# Notes on cross-compiling Python 3.6.0 pre releases
# Work in progress
# Build a native interpreter in tree, for use as PYTHON_FOR_BUILD later.
# You _might_ be able to avoid this by using a pre-installed python,
# but if e.g. /usr/bin/python is 3.5.x, then you'll get syntax errors when it
# tries import 3.6.x stdlib modules.
configure
make python
%TAG ! tag:nuxi.nl,2015:cloudabi/
---
stderr: !fd stderr
path: !file
path: _obj/install/x86_64-unknown-cloudabi/python/lib/python3.6
nousersite: true
nosite: true
command: >-
import sys;