Skip to content

Instantly share code, notes, and snippets.

@cjies
cjies / vapid_helper.py
Created November 22, 2019 04:44
Python based VAPID key-pair generator
import base64
import ecdsa
def generate_vapid_keypair():
"""
Generate a new set of encoded key-pair for VAPID
"""
pk = ecdsa.SigningKey.generate(curve=ecdsa.NIST256p)
vk = pk.get_verifying_key()
@cjies
cjies / CustomDialogExample.js
Last active June 19, 2017 13:20
Custom dialog with react-router v4
// -------------------------------------
// Example from react-router
// @ref https://reacttraining.com/react-router/web/example/preventing-transitions
// -------------------------------------
import React from 'react';
import {
BrowserRouter as Router,
Route,
Link
@cjies
cjies / .babelrc
Created March 26, 2017 08:26
es module bundling with babel
{
"presets": [
["env", { "modules": false }]
],
"env": {
"es": {},
"lib": {
"plugins": [
"transform-es2015-modules-commonjs"
@cjies
cjies / cloudSettings
Last active July 18, 2020 03:10
Visual Studio Code Sync Settings Gist
{"lastUpload":"2020-07-17T14:55:57.591Z","extensionVersion":"v3.4.3"}
@cjies
cjies / BEM.js
Last active July 27, 2016 15:47
BEM.js helper
// -------------------------------------
// BEM Helper
// Inspired by 14islands/bem-helper-js
// @ref https://github.com/14islands/bem-helper-js
//
// Usage:
// const bem = BEM('header');
// const bem2 = bem.element('title');
// const bem3 = bem2.modifier('highlight');
//