Skip to content

Instantly share code, notes, and snippets.

@glasserc
glasserc / benchmarks.py
Created October 15, 2019 17:53
Benchmarking fastecdsa vs. cryptography
import base64
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import ec as cryptography_ec
from cryptography.hazmat.primitives.asymmetric.utils import encode_dss_signature
from cryptography.hazmat.primitives.hashes import SHA384
from cryptography.hazmat.primitives.serialization import load_pem_public_key
import ecdsa.util
import ecdsa.curves
import fastecdsa.ecdsa
from fastecdsa.encoding.der import DEREncoder
@glasserc
glasserc / .babelrc
Last active October 16, 2020 15:51
Trying to figure out transform-builtin-extend, transform-runtime, etc.
{
"env": {
"development": {
"plugins": [
["transform-builtin-extend", {
"globals": ["Error"]
}],
"transform-runtime",
"transform-es2015-classes",
"transform-es2015-modules-commonjs"
@glasserc
glasserc / redate-photos.py
Created September 14, 2011 09:52
Program to adjust dates on EXIF tags for a bunch of JPEG files using python-exif and exiftool
#! /usr/bin/python
"""Program to fix my screwed up camera date/time settings.
At some point, some children adjusted the date on my camera as well as
the locale settings. Photos were henceforth marked as being one day
earlier than they should have been (i.e. the 28th instead of the 29th).
Later, I noticed that the camera date was wrong, but because the
equivalent of LC_DATE was different, I thought it was one MONTH early
instead of one DAY. I "fixed" it by putting the date on the camera
@glasserc
glasserc / monitor.vala
Created September 14, 2011 09:40
why Vala is not my favorite programming language
// monitor.vala: why Vala is not my favorite programming language.
//
// A program to walk the filesystem tree and install FileMonitors on
// every directory found, in order to test a limit on notifications.
// This will do a TON of I/O. On my machine it takes almost an hour
// to chew through my hard drive. The good news is that it doesn't
// hit a limit.
//
// FileMonitor is implemented I think using inotify, so if you're
// running Linux, the easier way to discover these limits is: