Skip to content

Instantly share code, notes, and snippets.

@flarn2006
flarn2006 / LogChatGPTImages.user.js
Created April 9, 2025 02:40
Userscript to log URL's of partially-generated ChatGPT images
// ==UserScript==
// @name Log ChatGPT Generated Image URLs
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Log the src of images with alt text "Generated image" on chat.openai.com
// @match https://chat.openai.com/*
// @match https://chatgpt.com/*
// @match https://www.chatgpt.com/*
// @grant none
// ==/UserScript==
#include <deque>
#include <random>
#include <cstdint>
#include <ctime>
#include <cstdlib>
#include <raylib.h>
#include <box2d/box2d.h>
constexpr int TILE_WIDTH = 9;
constexpr int TILE_HEIGHT = 16;
@flarn2006
flarn2006 / things_recipe_logger.py
Last active March 1, 2022 19:59
Things Recipe Logger
import flask
from flask_cors import CORS
flask_app = flask.Flask(__name__)
CORS(flask_app)
with open('recipes.txt', 'a') as f:
@flask_app.route('/recipe', methods=['POST'])
def flask_recipe():
text = flask.request.data.decode('utf-8')
@flarn2006
flarn2006 / unrand_count.c
Created October 10, 2021 20:06
Unrandomizer for LD_PRELOAD
// Created by flarn2006. WTFPL
// Compile with gcc, -fPIC -shared
#include <stdlib.h>
static int n = 0;
static int m = 0;
static int count()
{
@flarn2006
flarn2006 / srb2_wireshark.lua
Last active June 15, 2021 05:01
Wireshark dissector for Sonic Robo Blast 2 netplay
local srb2_proto = Proto('SRB2', 'Sonic Robo Blast 2')
srb2_proto.prefs.validate_checksum = Pref.bool('Validate checksums', false, 'Whether to validate the packet checksum')
local function add_fields(...)
for i,v in ipairs({...}) do
table.insert(srb2_proto.fields, v)
end
end
@flarn2006
flarn2006 / glmatrix.cpp
Last active April 28, 2021 03:14
FLTK-based application for experimenting with OpenGL matrices
/* Compile with -lGL -lfltk -lfltk_gl */
#include <Fl/Fl.h>
#include <Fl/Fl_Window.h>
#include <Fl/Fl_Box.h>
#include <Fl/Fl_Value_Input.h>
#include <Fl/Fl_Value_Output.h>
#include <Fl/Fl_Dial.h>
#include <Fl/Fl_Button.h>
#include <Fl/Fl_Gl_Window.h>
@flarn2006
flarn2006 / zigzag.c
Created December 25, 2020 21:04
Simple game based on a SmileBASIC example program
/* Requires raylib (compile with -lraylib) */
#include <raylib.h>
#include <stdlib.h>
#include <string.h>
#define WIDTH 400
#define HEIGHT 240
#define SAFE_AREA 50
#define BASE_COUNT 500
#define PER_LEVEL 100
#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <pthread.h>
#include <getopt.h>
#include <SDL2/SDL.h>
#define DEFAULT_ITER_COUNT 768
#define OPT_CLEAR 1
// ==UserScript==
// @name All GauGAN Labels
// @version 1
// @grant none
// @include http://34.216.122.111/gaugan/
// ==/UserScript==
function selectCategoryAll()
{
var palette = document.getElementById('palette');
@flarn2006
flarn2006 / rainbow.v
Created October 1, 2019 02:28
Rainbow fading RGB LED in Verilog
module rainbow (
input clk,
output red,
output grn,
output blu,
);
reg [26:0] counter;
wire [11:0] t;
wire [11:0] cmp;