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
import crypto from 'crypto' | |
import { writeFileSync } from 'fs' | |
async function exportCryptoKeyToPEM(key) { | |
const exported = await crypto.subtle.exportKey('pkcs8', key) | |
const pemExported = `-----BEGIN PRIVATE KEY-----\n${Buffer.from(exported).toString('base64')}\n-----END PRIVATE KEY-----` | |
return pemExported | |
} |
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
#!/bin/sh | |
version=v1.0.0 | |
os=$1 | |
arch=$2 | |
if [ -z "$os" ] || [ -z "$arch" ]; then | |
echo -n "What is your OS? [darwin/linux] " | |
read os < /dev/tty |
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
#!/usr/bin/env bash | |
DOMAIN=$1 | |
NS=$2 | |
TYPE=$3 | |
ORIG_SOA=$(dig SOA $1 | awk '{print $5}') | |
COMP_SOA=$(dig SOA $1 @$2 | awk '{print $5}') | |
echo -en "$ORIG_SOA\t" |
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
#!/bin/sh | |
version=v2.1.0 | |
os=$1 | |
arch=$2 | |
if [ -z "$os" ] || [ -z "$arch" ]; then | |
echo -n "What is your OS? [darwin/linux] " | |
read os < /dev/tty |
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
# βββ βββ βββββββ ββββββββββ | |
# βββ βββββββββββββββββββββββ | |
# βββ ββββββ βββββββββ βββ | |
# ββββ βββββββ βββββββββ βββ | |
# βββββββ ββββββββββββββββββββ | |
# βββββ βββββββ ββββββββββ | |
echo " _ _ " | |
echo " _ _ ___ |_| _| |" | |
echo " | | || . || || . |" |
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
import time | |
import math | |
def loader(index=0, total=100): | |
max = 25 | |
tty = math.floor(index * max / total) | |
bar = ('#' * tty) + ('_' * (max - tty)) | |
print('[{}] - {}/{}'.format(bar, index, total), end = '\n' if index == total else '\r') |
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
<datalist id="statelist"> | |
<option value="AL">Alabama</option> | |
<option value="AK">Alaska</option> | |
<option value="AZ">Arizona</option> | |
<option value="AR">Arkansas</option> | |
<option value="CA">California</option> | |
<option value="CO">Colorado</option> | |
<option value="CT">Connecticut</option> | |
<option value="DE">Delaware</option> | |
<option value="FL">Florida</option> |
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
function colorScale(int) { | |
let r, g, b = 0 | |
if (int >= 0 && int <= 20) { | |
r = 255 | |
g = Math.round(12.75 * int) | |
b = 0 | |
} else if (int > 20 && int <= 40) { | |
r = Math.round(-12.75 * int + 510) | |
g = 255 |
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
try { | |
// do something | |
} catch (e) { | |
console.warn(e.message) | |
const xcb = `https://stackoverflow.com/search?q=[js]+${e.message}` | |
window.open(xcb, '_blank') | |
} |
NewerOlder