Skip to content

Instantly share code, notes, and snippets.

@cjies
cjies / BEM.js
Last active Jul 27, 2016
BEM.js helper
View BEM.js
// -------------------------------------
// 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');
//
@cjies
cjies / cloudSettings
Last active Jul 18, 2020
Visual Studio Code Sync Settings Gist
View cloudSettings
{"lastUpload":"2020-07-17T14:55:57.591Z","extensionVersion":"v3.4.3"}
@cjies
cjies / .babelrc
Created Mar 26, 2017
es module bundling with babel
View .babelrc
{
"presets": [
["env", { "modules": false }]
],
"env": {
"es": {},
"lib": {
"plugins": [
"transform-es2015-modules-commonjs"
@cjies
cjies / CustomDialogExample.js
Last active Jun 19, 2017
Custom dialog with react-router v4
View CustomDialogExample.js
// -------------------------------------
// 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 / vapid_helper.py
Created Nov 22, 2019
Python based VAPID key-pair generator
View vapid_helper.py
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()