Skip to content

Instantly share code, notes, and snippets.

View Summertime's full-sized avatar
😳
programming

Andrew C. H. McMillan Summertime

😳
programming
View GitHub Profile
@Summertime
Summertime / growloop.js
Last active December 31, 2021 16:26
bitburner scripts
function shuffleArray(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
return array
}
/** @param {NS} ns **/
export async function main(ns) {
let args = ns.flags([
@Summertime
Summertime / bmark.sh
Last active November 22, 2021 17:31
benchmarking HTML vs JSON
#!/usr/bin/env bash
DATADIR=$(pwd)
TEMPDIR=
trap 'cd ~;rm -fr -- "$TEMPDIR"' EXIT
TEMPDIR=$(mktemp -d)
cd -- "$TEMPDIR"
mkdir {html,json}{-compressed,-dictionary,}
#!/usr/bin/env bash
shopt -s extglob
: ${WEBHOOK:?Requires envvar WEBHOOK}
for C in jq curl; do
if command -v "$C" > /dev/null; then
echo "Requires $C to be installed"
exit 1
fi
done
@Summertime
Summertime / color.sh
Created October 8, 2019 01:21
Detect color resolution of the terminal
#!/bin/sh
detect_color_resolution() {
# 24bit
if [ "$COLORTERM" = "truecolor" ]
then
printf '%s\n' 24
return
elif [ "$COLORTERM" = "24bit" ]
then

STPAK Specification Draft

Notes

All integers in the file are unsigned little endian, everything is little endian, unless otherwise specified! the packers / unpackers are expected to work across platforms however.

File layout

from signal import signal as _signal
from collections import defaultdict as _defaultdict
__all__ = ['pls_handle']
_pls_handlets = _defaultdict(list)
def _the_pls_handle_signal_handler(signalnum, frame):

EMail: ProtonMail

  • 👍 Pay via BTC, Card, ...?
  • 👍 Encryption/Decryption happen client side
  • 👍 Web client is open source
  • 👍 Located in Switzerland
  • 👎 Apps are closed source, IMAP bridge is closed source

VPN: Mullvad

  • 👍 Pay via BTC, BCH, Card, Cash, Bank wire, PayPal, Swish
  • 👍 Custom client is open source
{
"array" = [
"value"
"value"
]
"array_empty" = [
]
"array_nested" = [
[
[
#!/bin/dash
seq 1000000 |
sed 's|^|https://example.com/|' |
xargs -P20 -n1000 \
curl -sSNL -X HEAD --retry 5 -w '%{http_code},%{url_effective}\n' |
tee urls.txt