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 / bf.js
Last active August 14, 2023 08:53
dzr.Decode.blowfish
const Blowfish = (await import('./egoroof_blowfish-4.0.1.mjs')).Blowfish;
const bf = new Blowfish(Buffer.from(keys_array), Blowfish.MODE.CBC, Blowfish.PADDING.NULL);
bf.setIv(new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7]));
return bf.decode(buf_in, Blowfish.TYPE.UINT8_ARRAY);
@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
Created May 8, 2023 14:11
Random errors
#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 May 8, 2023 14:12
615A 8002/8004 LUH validator and YAML dumper
// BUILD:
// cc luh.c -o luh
// USAGE:
// luh < EXAMPLE.LUH > EXAMPLE.yml
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
@yne
yne / playlist.txt
Created November 2, 2020 06:49
playlist
Что такое осень ДДТ - Актриса весна
В последняя осень ДДТ - Актриса весна
Звезда по имени Солнце Kino - Звезда по имени Солнце
Дыхание Nautilus Pompilius - Крылья
Моё сердце Splean - 25 кадр
Просвистела ДДТ - Просвистела
Родина ДДТ - Актриса весна
Это всё ДДТ - Это всё
Ветер ДДТ - Это всё
Метель ДДТ - Мир номер ноль
@yne
yne / main.c
Created April 12, 2020 21:42
tilemap GL
//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 / spinner.css
Created December 25, 2019 22:16
spinner.css
.spinner{
color:transparent;
pointer-events:none;
user-select: none;
position: relative;
}
.spinner:after {
animation: dot 1s infinite;
content:"⠋";
color:initial;
@yne
yne / av1.c
Created August 20, 2019 18:02
av1-like decoder
#include <math.h>
#include <stdio.h>
#define e(a, d) for(a=0;a<d;a++)
int YUV[3][1 << 20], tmpyuv[2048], scratch[166], width;
int p = 0, r = 1;//reader accu
int lumaRatio = 0, satuRatio = 0;//decode default
void read8b() {
int b = getchar();