Skip to content

Instantly share code, notes, and snippets.

@aellerton
aellerton / README.md
Last active March 1, 2023 02:52
Vue component for recaptcha / grecaptcha / recaptcha2

Recaptcha2 Vue TypeScript component

A simple Recaptcha2 Vue component using TypeScript.

Just drop it in your source and it loads everything needed.

You'll need to create a grecaptcha site key:

https://www.google.com/recaptcha/admin

@aellerton
aellerton / README.md
Created June 11, 2018 06:38
Numeronym: shorten names in first-length-last style, like 'internationalization' to 'i18n'

Numeronym: shorten names like 'internationalization' to 'i18n' using Python

A "numeronym" is a "number-based word" (https://en.wikipedia.org/wiki/Numeronym).

The short python script generates these in the same style as "i18n", i.e. taking the first and last letter and showing the length (minus 2) in-between.

Use it either with arguments, like this:

@aellerton
aellerton / 0_export_public_key.py
Created May 23, 2018 06:14
Python sign message with private key and verify with public key
#!/usr/bin/env python
"""Extract the public key from the private key and write to a file.
"""
from Crypto.Hash import SHA256
from Crypto.Signature import PKCS1_v1_5
from Crypto.PublicKey import RSA
with open("private_key.pem", "r") as src:
private_key = RSA.importKey(src.read())