Skip to content

Instantly share code, notes, and snippets.

@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 / hotfix.diff
Created December 5, 2017 21:23
diff between existing and plausable hotfix
diff --git a/kinto/core/storage/postgresql/migrations/migration_019_hotfix.sql b/kinto/core/storage/postgresql/migrations/migration_019_hotfix.sql
index 1795b55a..bab9234d 100644
--- a/kinto/core/storage/postgresql/migrations/migration_019_hotfix.sql
+++ b/kinto/core/storage/postgresql/migrations/migration_019_hotfix.sql
@@ -5,29 +5,36 @@ RETURNS trigger AS $$
DECLARE
previous TIMESTAMP;
current TIMESTAMP;
+ is_bucket BOOLEAN;
BEGIN
@glasserc
glasserc / action.js
Created January 18, 2019 18:03
Flow types at module boundary
/* @flow */
export type ActionType = "hello";
export function action(): ActionType {
return "hello";
}
@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