Skip to content

Instantly share code, notes, and snippets.

View yne's full-sized avatar
✔️
Not a virus

Rémy F. yne

✔️
Not a virus
View GitHub Profile
@yne
yne / appraise.html
Last active December 17, 2024 00:59
Github API based appraise
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="color-scheme" content="dark light">
<title>Peer Review Framework</title>
<link rel="stylesheet" href="style.css">
<link rel="icon"
href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><path d='M4,5C2,7,-1.5,4,1,1C4,-1.5,7,2,5,4L8,7L7,8M1.5,1.5C0,3,2,6,4,4C6,2,3,0,1.5,1.5'></path></svg>">
<nav>
<a href="#/">Home</a>
<a href="#/orgs">My Orgs</a>
@yne
yne / renault.js
Created August 18, 2024 16:14
Renault Car Radio Unlock Code Generator
/*
Generate Unlock Code for Clio, Duster, Espace, Kangoo, Laguna, Logan, Master, Megane, Safrane, Scenic, Symbol, Trafic, Twingo
Using the PRE code (1 letter, 3 numbers) which can either be found
- by turning on the radio and simultaneously press the buttons “1” and “6” for about five seconds
- by extracting the radio from it slot and looking bellow the barcode sticker
*/
function renault(a, b, c, d) { // 'A', 1, 0, 0
left = (a.charCodeAt(0) - 65) * 10 + b;
right = ((left + c * 10 + d) * 7) % 100;
@yne
yne / index.html
Created May 14, 2023 21:37
llama.cpp minimal websocket based interface
<html lang=en>
<!--
clone+make llama.cpp, mkdir static, put this file as index.html in it, then run
websocketd --port=8080 --staticdir=static --binary=true ./main -m models/ggml-vic7b-uncensored-q4_0.bin -n 50 --interactive-first
-->
<form name=prompt style=display:grid>
<textarea name=stdin placeholder=prompt style=resize:vertical></textarea>
<button>send</button>
<pre style="white-space: break-spaces"><output name=stdout></output></pre>
<input type=hidden name=continue value=continue>
@yne
yne / messagebox.c
Last active August 18, 2024 14:57
Memes and errors in Win32
#include <windows.h>
#define _countof(array) (sizeof(array) / sizeof(array[0]))
struct Bidon
{
char *msg;
char *title;
UINT type;
} messages[] = {
{"Hi, I am Albanian virus but because of poor technology in my country unfortunately I am not able to harm your computer.\nPlease be so kind to delete one of your important files yourself and then forward me to other users.\n\nMany thanks for your cooperation!\n\nBest regards,\n\t\t\tAlbanian virus", "Virus Alert !", MB_USERICON | MB_YESNOCANCEL},
@yne
yne / xls2json.sh
Created February 12, 2023 16:16
excel sheet to json
python -c 'import openpyxl,sys,json; json.dump([[cell.value for cell in row] for row in openpyxl.load_workbook(sys.stdin.buffer).worksheets[int(sys.argv[1])].iter_rows()], sys.stdout)' 3 < my.xlsm | jq
@yne
yne / luh.c
Last active December 3, 2024 15:56
615A 8002/8004 LUH JSON dumper
// BUILD:
// cc luh.c -o luh
// USAGE:
// luh < EXAMPLE.LUH > EXAMPLE.json
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
@yne
yne / main.c
Last active August 18, 2024 17:37
mode7 style tilemap X11+GL (require a 32x32 ./sprite.bmp)
//c99 main.c -o ../main -lX11 -lGL -lGLU && cd .. && ./main
#include <stdio.h>
#include <stdlib.h>
#include <X11/X.h>
#include <GL/gl.h>
#include <GL/glx.h>
GLuint texture[1];
int initGL(GLfloat width,GLfloat height){
typedef uint8_t Sprite[32*32*3];
@yne
yne / mips-gen.c
Created December 30, 2019 21:38
unfinished MIPS generator for TCC
/*
* MIPS3K code generator for TCC
*
* Based on mips-gen.c by Daniel Glöckner & Thomas Preud'homme
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
@yne
yne / epoll.c
Last active August 18, 2024 15:20
Tiny epoll-based HTTP server
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/epoll.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
@yne
yne / dom.c
Last active August 18, 2024 15:46
DOM for TTY
#include <stdio.h>
#include <stdint.h>
#include <termios.h>
#define LEN(ARR) ARR,sizeof(ARR)/sizeof(*ARR)
#define RGBA(R,G,B,A) ((R<<24) | (G<<16) | (B<<8) | A)
#define RGB(R,G,B) RGBA(R,G,B,255)
typedef enum{
RULE_NOP,
RULE_TEXT_COLOR,