Skip to content

Instantly share code, notes, and snippets.

View coolaj86's full-sized avatar
😎
🐹 Go 🦎 Zig 📦 Node 🐧 POSIX 🪟 PowerShell

AJ ONeal coolaj86

😎
🐹 Go 🦎 Zig 📦 Node 🐧 POSIX 🪟 PowerShell
View GitHub Profile
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>
Multi-Section Code Carousel with Active Section and Hash Routing
</title>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css"
\       escape

^       match start (or negate group)
$       match end

.       match any character (except newlines, [\s\S] to match newlines too)
[]      match range (see examples below)
[^]     negative match range, such as [^<]* (match up to but not including the next `<`)
@coolaj86
coolaj86 / AiScript-Engineer-INSTRUCTIONS.md
Last active September 29, 2024 08:48
AiScript Engineer (GPT)

Goal

Create a GPT that can assist me.

It should be able to write code in my style.

Write a "Hello World"-style REST API that uses reCAPTCHA for validation before allowing access to other API routes.

Rules

@coolaj86
coolaj86 / recaptcha-express-gpt.js
Created September 19, 2024 22:29
A Simple Demo using Google reCAPTCHA with Express, lovingly coaxed out of GPT4o with a heavy hand.
const express = require('express');
const AsyncRouter = require('@root/async-router');
const fetch = require('node-fetch'); // For making external API requests
const app = AsyncRouter.Router();
// Secret key for reCAPTCHA
const RECAPTCHA_SECRET_KEY = 'YOUR_SECRET_KEY';
app.post('/api/process-payment', async (req, res) => {
@coolaj86
coolaj86 / notes-on-pci-compliance.md
Created September 18, 2024 05:45
Notes on PCI Compliance

Copied from https://github.com/bnnanet/bnna-payment-gateway.js/issues/5 for the immediate benefit of others, to be available as a Public gist until we make the whole repo public (once it's useful).

Key Takeaways

  • We should limit stored data to what's required for a specific, known business purposes
    (not "just in case it's useful")
  • We may, for internal use, salt and hash the full credit card number (with per-vendor salts)
    • We MUST NOT expose that salt or hash via API
  • We may create a 1:1 mapping with a random (or otherwise unrelated) key and the salted hash
  • This is the user-facing identifier
@coolaj86
coolaj86 / timeout.rs
Last active September 12, 2024 19:23
POSIX.1-2024 timeout implemented in Rust
// generated by GPT4o using the command summary in this README as the prompt:
// https://github.com/posix-utilities/timeout
use std::process::{Command, ExitStatus};
use std::time::Duration;
use std::os::unix::process::CommandExt;
use std::sync::{Arc, atomic::{AtomicBool, Ordering}};
use std::thread;
use nix::sys::signal::{self, Signal};
use std::env;
use std::ffi::OsString;
@coolaj86
coolaj86 / Plaid Security Questionnaire (v6).md
Created September 1, 2024 01:40
Plaid Security Questionnaire (v6)

Plaid Security Questionnaire (v6)

Part One

Hosting (inf_sec_hosting)

  1. What is your organization's strategy for hosting the server-side components of your application?
    • On-prem hosting - We host all server-side components of our application using on-premise physical infrastructure
@coolaj86
coolaj86 / proxmox-container-urls.md
Last active August 25, 2024 23:27
Proxmox PVE Container Image Download URLs

Proxmox's pveam update fetches releases from http://download.proxmox.com/images/aplinfo-pve-8.dat and https://releases.turnkeylinux.org/pve/aplinfo.dat, which can be changed in /usr/share/perl5/PVE/APLInfo.pm.

The dat files contain the names of images which can you use to get the direct pveam download download URLs, for example: