const hexCsb = require("hex-csb")
const csbHex = require("csb-hex")
hexCsb("#90dffe")
//=> [82, 41, 33]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const devcert = require("devcert"); | |
const app = express(); | |
(async () => { | |
const ssl = await devcert.certificateFor("localhost"); | |
https.createServer(ssl, app).listen(3000); | |
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pSpread = require("p-spread") | |
pSpread(Promise.resolve([1, 2]), console.log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gcd = (a, b) => { | |
if (typeof a !== "number") { | |
throw new TypeError(`Expected number, got ${typeof a}`) | |
} | |
if (typeof b !== "number") { | |
throw new TypeError(`Expected number, got ${typeof b}`) | |
} | |
if (b === 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.not = a => !a | |
exports.or = (a, b) => a || b | |
exports.nor = (a, b) => !a && !b | |
exports.and = (a, b) => a && b | |
exports.nand = (a, b) => !a && !b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const internalIp = async () => { | |
if (!RTCPeerConnection) { | |
throw new Error("Not supported.") | |
} | |
const peerConnection = new RTCPeerConnection({ iceServers: [] }) | |
peerConnection.createDataChannel('') | |
peerConnection.createOffer(peerConnection.setLocalDescription.bind(peerConnection), () => { }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{0eca68b7-6ef1-402f-b212-a6a02220ae13}", | |
"theme": "dark", | |
"profiles": [ | |
{ | |
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", | |
"name": "Windows PowerShell", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MIT License | |
Copyright (c) 2020 Richie Bendall | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
I hereby claim:
- I am Richienb on github.
- I am richienb (https://keybase.io/richienb) on keybase.
- I have a public key whose fingerprint is 8D82 25A7 B9A4 B05A 1412 5906 3D6E BC25 5449 456A
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { promisify } = require("util") | |
const sendmail = promisify(require("sendmail")({ silent: true })) | |
module.exports = async (options) => { | |
await sendmail(options) | |
} |