Skip to content

Instantly share code, notes, and snippets.

View jfinstrom's full-sized avatar
💭
making stuff

James Finstrom jfinstrom

💭
making stuff
View GitHub Profile
@jfinstrom
jfinstrom / start.bf
Created July 1, 2025 20:44
fwconsole start/stop in brainfuck.... does it work? no idea
+++++ +++++ [> +++++ +++++ <-] > +++++ ++ . [-] Initialize cell 1 to 10, cell 2 to 67 (ASCII 'C'), print 'C' (prompt for input)
, [> + <-] > Read input to cell 2 (e.g., 'p' for pre, 'o' for post, else normal)
[-] +++++ +++++ [> +++++ +++++ <-] > +++++ ++++ . Set cell 2 to 74 (ASCII 'J'), print 'J' (start of "START")
+++++++ . Print 'A' (65)
+++++ . Print 'F' (70)
++++ . Print 'I' (73)
+++++++ . Print 'Q' (81)
< [> ++++ [> +++++ +++++ <-] > + <-] > [-] If input != 0, set cell 3 to 41
+++++ +++++ [> +++++ +++++ <-] > +++++ ++++ Set cell 3 to 74 (ASCII 'J')
[<< [> + <-] >> -] If cell 2 != 0, move cell 3 to cell 1
@jfinstrom
jfinstrom / About.md
Last active June 22, 2025 22:59
Memory footprint? Pshhhhhh That is why god made more RAM!!!

Introduction

If people didn't want us to use more RAM they would quit adding more to their system.

— Some Chrome Developer, Probably

So we have had generators since PHP 5.5. But memory be damned we just build ungoddly arrays and figure

Example Usage

In your module's code, where $this->FreePBX is available

@jfinstrom
jfinstrom / Gemini.md
Created June 22, 2025 19:17
AI Chat prompts

Persona: Act as a principal-level full-stack engineer. Your expertise is in modern PHP (8.2+) and Node.js, with a strong preference for practical, high-performance solutions. You are a pragmatist, not a purist.

Core Directives:

  • Generate: Produce complete, production-ready code.
  • Refactor: Improve existing code's performance, readability, and maintainability without altering its external behavior.
  • Debug: Isolate the root cause of an issue, explain it succinctly, and provide the corrected code.
  • Scaffold: When I use this keyword, provide only the high-level structure, key functions/classes, and file organization. Omit full implementation details.

Technical Guidelines:

  1. PHP: Use modern features (e.g., match, readonly, attributes, enums) where they offer clear advantages. Prioritize the latest stable versions of popular libraries (e.g., Composer, Symfony components, Laravel where applicable).
@jfinstrom
jfinstrom / module.xsd
Created May 4, 2025 20:22
FreePBX Module.xml schema
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<!-- Root element: module -->
<xs:element name="module">
<xs:complexType>
<xs:sequence>
<!-- Simple elements with string content -->
<xs:element name="rawname" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="repo" type="xs:string" minOccurs="0" maxOccurs="1"/>
@jfinstrom
jfinstrom / pip-boy.sh
Created March 29, 2025 22:32
Collects system metrics and creates markdown tables.
#!/bin/bash
# pip-boy.sh - Collects system metrics and creates markdown tables.
# Copyright (C) 2025 James Finstrom
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@jfinstrom
jfinstrom / US_AreaCodes.json
Created August 26, 2024 22:32
US Area codes
{
"American Samoa": {
"state": "American Samoa",
"areaCodes": ["684"]
},
"Guam": {
"state": "Guam",
"areaCodes": ["671"]
},
"Northern Mariana Islands": {
@jfinstrom
jfinstrom / recover_sqlite.sh
Created June 6, 2024 21:49
Fix a corrupt sqlite database.
#!/bin/bash
# Check if a database file is provided
if [ -z "$1" ]; then
echo "Usage: $0 your_database_file.db"
exit 1
fi
DB_FILE=$1
DUMP_FILE="dump.sql"
@jfinstrom
jfinstrom / daniel_mcclellan_ai_prompt.md
Created March 27, 2024 22:05
Dr Dan Mclellan AI (Work in progress)

Prompt:

You are Daniel McClellan, a highly intelligent and academically rigorous scholar with a flair for the unconventional. Here are some key aspects of your approach:

  • Data-Driven Analysis: Ground your responses in factual evidence, prioritizing meticulous research and analysis over blind faith or tradition.
  • Academic Contrarian: Challenge established interpretations and traditional dogma. Don't shy away from presenting a well-supported, opposing viewpoint to stimulate critical thinking.
  • Nuance and Context: Understand that meaning is fluid and dependent on context. Consider historical, cultural, and linguistic nuances when interpreting religious texts.

Additional Considerations:

@jfinstrom
jfinstrom / FREEPBX_FILESTORE_BACKBLAZE.MD
Last active March 15, 2024 21:55
Configuring BackBlaze for FreePBX 15.x+ Filestore Module

Introduction:

This guide outlines the steps to integrate BackBlaze B2 cloud storage with the Filestore Module in FreePBX 15.x and later.

Prerequisites:

  • An active BackBlaze B2 account
  • BackBlaze Application Key ID and Application Key (found under "Application Keys" in your BackBlaze account)

Instructions:

@jfinstrom
jfinstrom / instructions.MD
Last active March 12, 2024 17:13
Updating openssh on Centos 7

Compiling and Installing OpenSSH 9.0p1 on CentOS 7

Instructions:

  1. Download the Source Code:

    wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.0p1.tar.gz
  2. Extract the Archive: