Skip to content

Instantly share code, notes, and snippets.

View rexim's full-sized avatar
📺
https://twitch.tv/tsoding

Alexey Kutepov rexim

📺
https://twitch.tv/tsoding
View GitHub Profile
( Copyright 2024 Alexey Kutepov <reximkut@gmail.com> )
( Permission is hereby granted, free of charge, to any person obtaining )
( a copy of this software and associated documentation files (the )
( "Software"), to deal in the Software without restriction, including )
( without limitation the rights to use, copy, modify, merge, publish, )
( distribute, sublicense, and/or sell copies of the Software, and to )
( permit persons to whom the Software is furnished to do so, subject to )
( the following conditions: )
open Printf
exception Goto of string
let label (name: string) = ()
let goto (name: string) = raise (Goto name)
let goto_block (blocks: (string * (unit -> unit)) list): unit =
let rec goto_block_impl (name: string option): unit =
try
@rexim
rexim / main.rs
Last active April 3, 2024 19:40
The Most Memory Safe Buffer Overflow in Rust!
// The Most Memory Safe Buffer Overflow in Rust!
//
// Consider all the code below under Public Domain
//
// How to build:
// $ rustc main.rs
//
// Wrong password:
// $ printf "hello\n" | ./main
//
BITS 64
%define SYS_exit 60
%define SYS_read 0
%define SYS_write 1
%define SYS_rt_sigaction 13
%define SYS_rt_sigreturn 15
%define STDIN 0
%define STDOUT 1
%define SIGINT 2
use std::io;
use std::io::Write;
use std::fs::File;
use std::process::Command;
#[derive(Debug, Clone, Copy)]
enum DataType {
Int,
Ptr,
Bool,
// Copyright 2021 Alexey Kutepov <reximkut@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
@rexim
rexim / 0001-Make-it-possible-to-include-files-over-https.patch
Last active April 13, 2024 15:16
TCC patch that enables including files via HTTPS using CURL
From 84c42091cbae3735c52e895221f3f95a87155756 Mon Sep 17 00:00:00 2001
From: rexim <reximkut@gmail.com>
Date: Wed, 30 Jun 2021 20:43:47 +0700
Subject: [PATCH] Make it possible to include files over https
---
Makefile | 2 +-
tcc.c | 5 +++++
tccpp.c | 43 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 49 insertions(+), 1 deletion(-)
@rexim
rexim / emoteJAM.md
Last active May 2, 2021 09:25
emoteJAM Elevator Pitch Document

emoteJAM

emoteJAM is a simple website that generates animated BTTV emotes from static images.

That idea is to apply a well established "meme meta filters" to static emotes. Such as JAM, Hop, etc.

The most important feature of the website is that it's completely client-side and can be easily deployed to something like GitHub Pages. It uses WebGL to animate static images and gif.js to generate actual GIF files inside of your browser.

The project is currently in development and not available to general public until it's more or less feature-complete.

#!/usr/bin/env python3
# https://www.hackerrank.com/challenges/alphabet-rangoli/problem
import math
# ----c----
# --c-b-c--
# c-b-a-b-c
# --c-b-c--
@rexim
rexim / main.c
Created March 30, 2021 11:46
Simple dl example using SDL2 on Linux
// $ cc -o main main.c -ldl
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <dlfcn.h>
#define SDL_LIBRARY_NAME "libSDL2-2.0.so"
#define SDL_INIT_VIDEO 0x00000020u
#define SDL_WINDOW_RESIZABLE 0x00000020