Skip to content

Instantly share code, notes, and snippets.

View PJensen's full-sized avatar

Pete Jensen PJensen

View GitHub Profile
@PJensen
PJensen / line-forgehtml
Last active June 26, 2026 14:45
writing tool
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Lineforge · Predictive Writer</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
:root {
color-scheme: light;
--bg0:#fff7df;
@PJensen
PJensen / js-hack-lighting-engine.html
Created June 11, 2026 12:43
A demo of the JS-Hack lighting engine
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>JSHack Lighting Engine — One-Shot</title>
<style>
:root {
color-scheme: dark;
--panel: #101319;
@PJensen
PJensen / WordleSolver.py
Last active February 10, 2022 15:39
Solves Wordle Puzzles with Input from User
from functools import reduce
import os, sys, time, string
from turtle import down
import urllib.request
import urllib
class WordleSolver:
"""
Solves Wordle Puzzles with feedback from the user
https://www.powerlanguage.co.uk/wordle/
public static void moveZeros(ref int[] numbers)
{
// Create a new array of the same size, NOTE: it's already initialized with zeros
var newArray = new int[numbers.Length];
// the "otherIndex" is used to separately track non-zero entries in the copy
int otherIndex = 0;
for (int index = 0; index < numbers.Length; index++)
{
@PJensen
PJensen / Perceptron.cs
Last active February 28, 2019 18:49
A refactorted and object oriented version of the procedural Perceptron outlined http://www.codingvision.net/miscellaneous/c-perceptron-tutorial
public class EntryPoint
{
public static void Main(string[] args)
{
var n0 = new Perceptron(2);
do
{
n0.ResetErrorTracking();
@PJensen
PJensen / Sample.cs
Last active December 2, 2016 19:08
Samples the collection using a uniform distribution, do not repeat elements.
/// <summary>
/// SampleService
/// </summary>
public class SampleService
{
private readonly Random _random;
/// <summary>
/// Initializes a new instance of the <see cref="SampleService"/> class.
/// </summary>
@PJensen
PJensen / ByteArray.cs
Created October 30, 2016 18:44
A small command line tool to convert an input file into a C# byte array
using System;
using System.IO;
using System.Linq;
using System.Text;
namespace ByteArray
{
internal class EntryPoint
{
private static readonly string[] helpCmds = { "help", "/?", "--help", "-help", "-h" };
@PJensen
PJensen / Dungeon.xml
Last active April 28, 2016 03:33
Dungeon XML (Experimental)
<?xml version="1.0" encoding="utf-8"?>
<Map>
<Rooms>
<Room Id="Room0" Length="20" Width="20">
<Decorations>
<Decoration Id="Room0_Altar" Type="Altar" OnEvent="Room0_Altar__Pray"/>
</Decorations>
<Thresholds>
<Door Orientation="Right" Alignment="Center" Id="Room0_Door0" Locked="True"/>
<Opening Orientation="Left" Alignment="Center" Id="Room0_Opening0"/>
@PJensen
PJensen / MotleyFoolCapsRatingClient.cs
Last active August 18, 2025 12:28
Downloads CAPS ratings from the Motley Fool API
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
using System.Xml.Serialization;
@PJensen
PJensen / SocketableWeapons.cs
Created October 21, 2015 22:53
The following demonstrates a basic idea for socket-able weapons.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SocketableWeapons
{
internal class Program
{
private static void Main(string[] args)