Skip to content

Instantly share code, notes, and snippets.


Rithvik Vibhu rithvikvibhu

View GitHub Profile
View login-with-hns.js
const fs = require('fs');
const crypto = require('crypto');
const decB64 = b64 => Buffer.from(b64, 'base64').toString('ascii');
const encB64 = ascii => Buffer.from(ascii).toString('base64');
const saveKeyToFile = (filename, key) =>
fs.writeFileSync(filename, key.export({ type: 'pkcs8', format: 'pem' }));
const loadKeyFromFile = filename => loadRawKey(fs.readFileSync(filename));
const loadRawKey = raw => crypto.createPrivateKey(raw);
pedrouid /
Created Dec 15, 2018
Web Cryptography API Examples
pikhovkin /
Last active Feb 16, 2022
Repeat on each page of complex headers (eg, tables) except the first page
# coding: utf-8
from weasyprint import HTML, CSS
def get_page_body(boxes):
for box in boxes:
if box.element_tag == 'body':
return box