Skip to content

Instantly share code, notes, and snippets.

View robherley's full-sized avatar
curl tiny.coffee

Rob Herley robherley

curl tiny.coffee
View GitHub Profile
@robherley
robherley / 🥧.md
Created April 19, 2022 01:43
🧜‍♀️
%%{init: {'theme': 'base', 'themeVariables': { 'fontFamily': 'monospace', 'pieSectionTextSize': '24px', 'darkMode': true, 'pie1': '#2da44e', 'pie2': '#dbab0a', 'pie3': '#cf222e' }}}%%
pie title 🧪 GitHubActionsTestLogger.Tests
    "Passed" : 10
    "Skipped" : 2
    "Failed" : 1
@robherley
robherley / crc64.ts
Last active April 26, 2022 23:07
crc64 investigation
import fs from 'fs'
import crypto from 'crypto'
import * as Benchmark from 'benchmark'
// When transpile target to >= ES2020 (prob after dropping node 12) these can be changed to bigint literals
// ts(2737)
// Based on 0x9A6C9329AC4BC9B5 Polynomial from Azure Storage https://github.com/Azure/azure-storage-net
const TABLE = [
BigInt("0x0000000000000000"), BigInt("0x7F6EF0C830358979"), BigInt("0xFEDDE190606B12F2"), BigInt("0x81B31158505E9B8B"),
@robherley
robherley / instructions.js
Last active December 19, 2022 02:16
GB Instructions JSON to Go maps
const { unprefixed, cbprefixed } = require("./Opcodes.json");
const opToCode = (mnemonic, op) => {
const name = op.name.toUpperCase();
// for hex used in RST
if (mnemonic === "RST" && name.endsWith("H")) {
return `Byte(0x${name.slice(0, -1)})`;
}
@robherley
robherley / main.go
Last active March 17, 2022 20:28
Checking Chunk Uploads
package main
import (
"crypto/md5"
"fmt"
"os"
)
const chunkSize = 8388608
@robherley
robherley / config.json
Created December 19, 2021 23:19
DDNS Config
{
"cloudflare": [
{
"authentication": {
"api_token": "<omitted>"
},
"zone_id": "<omitted>",
"subdomains": ["*"],
"proxied": false
}
According to all known laws
of aviation,
there is no way a bee
should be able to fly.
Its wings are too small to get
its fat little body off the ground.
@robherley
robherley / checker.js
Created April 6, 2021 14:19
vaccine checker
const axios = require("axios");
const _ = require("lodash");
const URL =
"https://am-i-eligible.covid19vaccine.health.ny.gov/api/get-providers";
const PAYLOAD = {
address: "11746",
applicationId: "5617632692458176706",
dob: "03/02/1997",
miles: "100",
package main
import (
"fmt"
"image"
"image/color"
"image/png"
"os"
"github.com/nfnt/resize"
package main
import (
"context"
"fmt"
"net/http"
"time"
"github.com/gorilla/websocket"
_ "github.com/joho/godotenv/autoload"
@robherley
robherley / DiamondThing.java
Last active November 14, 2019 02:44
Java program to print an ASCII '*' diamond
public class DiamondThing {
static int MAX_ROW_LEN = 5; // should always be an odd num to work properly
public static void main(String[] args) {
// from i -> the max, add 2 everytime
for (int currRowLen = 1; currRowLen <= MAX_ROW_LEN; currRowLen += 2) {
// we need to do a little arithmetic to figure out how many spaces
int numPrefixSpaces = MAX_ROW_LEN - currRowLen / 2;
for (int space = 0; space < numPrefixSpaces; space++) {