Skip to content

Instantly share code, notes, and snippets.

View jeswin's full-sized avatar

Jeswin jeswin

View GitHub Profile
@jeswin
jeswin / Export each as SVG.js
Created March 18, 2021 13:21 — forked from vieron/Export each as SVG.js
Export each as SVG. Modified some lines from the original by Aaron Beall (http://fireworks.abeall.com/extensions/commands/Export/Export%20SVG.jsf) to export each selected object as a separate SVG file.
// Fireworks JavaScript Command
// Exports current document state as SVG graphics format
// Install by copying to Fireworks/Configuration/Commands/
// Run via the Commands menu in Fireworks
// Aaron Beall 2010-2011
// Version
var VERSION = "0.6.1";
// Params
@jeswin
jeswin / create-jwt-rs256.sh
Last active May 8, 2021 07:44
Create a JWT
basho \
--import fs fs \
--import crypto crypto \
-d header '{ "alg": "RS256", "type": "JWT" }' \
-d payload '{ "sub": "alice", "iss": "example.com", "iat": Date.now() }' \
-d toBase64 'x => Buffer.from(JSON.stringify(x)).toString("base64")' \
-d toBase64Url 'x => x.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_")' \
-d base64Header 'k.toBase64Url(k.toBase64(k.header))' \
-d base64Payload 'k.toBase64Url(k.toBase64(k.payload))' \
-d privateKey 'fs.readFileSync(process.cwd() + "/privatekey.pem", "utf8")' \