Skip to content

Instantly share code, notes, and snippets.

View things_recipe_logger.py
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 Oct 10, 2021
Unrandomizer for LD_PRELOAD
View unrand_count.c
// 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 Jun 15, 2021
Wireshark dissector for Sonic Robo Blast 2 netplay
View srb2_wireshark.lua
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 Apr 28, 2021
FLTK-based application for experimenting with OpenGL matrices
View glmatrix.cpp
/* 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 Dec 25, 2020
Simple game based on a SmileBASIC example program
View zigzag.c
/* 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
View mandelbrot.c
#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
View allGauGANLabels.user.js
// ==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 Oct 1, 2019
Rainbow fading RGB LED in Verilog
View rainbow.v
module rainbow (
input clk,
output red,
output grn,
output blu,
);
reg [26:0] counter;
wire [11:0] t;
wire [11:0] cmp;
@flarn2006
flarn2006 / gt-reverse.js
Last active Oct 14, 2018
Reverse text button for Google Translate
View gt-reverse.js
// ==UserScript==
// @name Google U.G.E.
// @version 1.1
// @grant none
// @include https://translate.google.com/*
// ==/UserScript==
window.addEventListener('load', function() {
var btn = document.createElement('div');
btn.setAttribute('class', 'jfk-button-standard jfk-button-narrow jfk-button');
@flarn2006
flarn2006 / fakehash.patch
Created Jul 1, 2017
Patch for Git to use one-byte "SHA1" hashes
View fakehash.patch
diff --git a/sha1dc/sha1.c b/sha1dc/sha1.c
index 3a1735e..67cf753 100644
--- a/sha1dc/sha1.c
+++ b/sha1dc/sha1.c
@@ -1829,25 +1829,9 @@ int SHA1DCFinal(unsigned char output[20], SHA1_CTX *ctx)
ctx->buffer[63] = (unsigned char)(total);
sha1_process(ctx, (uint32_t*)(ctx->buffer));
output[0] = (unsigned char)(ctx->ihv[0] >> 24);
- output[1] = (unsigned char)(ctx->ihv[0] >> 16);
- output[2] = (unsigned char)(ctx->ihv[0] >> 8);