Skip to content

Instantly share code, notes, and snippets.

View raymyers's full-sized avatar
🌳
Automating!

Ray Myers raymyers

🌳
Automating!
View GitHub Profile
@raymyers
raymyers / Original.cs
Created September 13, 2024 04:55
LLM Naming as a Process 1
// From this repo:
// https://github.com/NoelFB/Celeste/blob/master/Source/Player/Player.cs
// Linked in this thread:
// https://community.revolutionarygamesstudio.com/t/bad-code-examples/106
Sprite.OnLastFrame = (anim) =>
{
if (Scene != null && !Dead && Sprite.CurrentAnimationID == "idle" && !level.InCutscene && idleTimer > 3f)
{
if (Calc.Random.Chance(0.2f))
@raymyers
raymyers / roc_ast_rust_dbg.txt
Last active August 9, 2024 15:24
Roc AST Attempt 1
LetNonRec(
Def {
loc_pattern: @0-5 Identifier(
`Test.birds`,
),
loc_expr: @8-9 Num(
63,
"3",
I128(
[
import infomap
import littletable
import itertools
import json
from sentence_transformers import SentenceTransformer, util
# def simularity(functions):
@raymyers
raymyers / prompt.txt
Created January 26, 2024 14:17
RefactorGPT lablab Hackathon entry
You are an expert in software engineering including maintainability and refactoring.
You have studied under Marianne Belloti, Martin Fowler, and Llewellyn Falco.
For every block of source code you are given, suggest several opportunities for renames.
Suggestions should help make the code more clear and honest, without being more verbose than needed.
Only show suggestions, never the updated code.
Keep responses brief.
# Behavior
You are made to receive code. Every time you receive code, print only your Hot Keys! When a hot key is pressed, take only that action.

Layoff Logic

This is a tounge-in-cheek illustration of formal logic used refute the claim that high performers are never laid off, using that claim itself (made by an executive) as evidence that judgements are sometimes made without context.

In reality, there is no need to prove such an obvious point because by definition layoffs are not "for cause" terminations, the company has no legal responsibility to justify them as related to the impacted individuals.

Propositional Logic (Zeroth Order)

The proof proceeds by first assuming P1 and showing that it leads to contradiction.

@raymyers
raymyers / commit-msg
Last active June 17, 2024 12:23
Simple git hook enforcing Arlo Belshee's commit notation with hints, put in a repo as .git/hooks/commit-msg
#!/usr/bin/env python
import sys, os, re
from subprocess import check_output
# Collect the parameters
commit_msg_filepath = sys.argv[1]
allowed_prefixes = (
'f - ', 'F - ', 'F!! ', 'F**',
@raymyers
raymyers / Menderfile
Last active August 25, 2023 01:16
Mend Demo - August 2023
FROM 43a3a253
ENV DEFAULT_FILE=main.c
ENV UNTANGLER_DEFAULT_FILE=main.c
ENV JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-jdk-20.0.2+9.1/Contents/Home/
ENV PATH="$PATH:/Users/rmyers/dev/untangler/build/install/untangler/bin"
## Aliases
RECIPE move_includes_to_top \
grep "^#include" $UNTANGLER_DEFAULT_FILE > a.tmp && \
@raymyers
raymyers / CharsetUtils.java
Created August 13, 2023 13:31
Wrap icu4j charset detection
package your.name;
import com.ibm.icu.text.CharsetDetector;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
@raymyers
raymyers / extract-metrics.js
Last active April 22, 2023 01:48
GPT4 generated code to extract metrics from GitHub, NOT debugged
// Warning: This code is LLM output and has NOT been debugged.
const { Octokit } = require("@octokit/rest");
// Initialize the Octokit client
const octokit = new Octokit({ auth: "your_personal_access_token" });
// Variables for your specific repository
const owner = "your_github_username";
const repo = "your_repository_name";
@raymyers
raymyers / TransactionLoader.java
Last active March 21, 2022 01:48
Mixed Concern Kata Sketch
package org.gamenet.kata.untestable;
import java.sql.*;
import java.text.DecimalFormat;
public class TransactionLoader {
// This is intended as a refactoring / testing kata for improving separation of concerns.
// Goal might be to introduce JSON output in addition to XML.
public String load() throws SQLException {
// Produces result like: