Skip to content

Instantly share code, notes, and snippets.

Avatar
📺
https://twitch.tv/tsoding

Alexey Kutepov rexim

📺
https://twitch.tv/tsoding
View GitHub Profile
@rexim
rexim / main.rs
Last active Aug 1, 2022
The Most Memory Safe Buffer Overflow in Rust!
View main.rs
// 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
//
View sigaction.asm
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
View persistent-stack.rs
use std::io;
use std::io::Write;
use std::fs::File;
use std::process::Command;
#[derive(Debug, Clone, Copy)]
enum DataType {
Int,
Ptr,
Bool,
View ll.h
// 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
Created Jun 30, 2021
TCC patch that enables including files via HTTPS using CURL
View 0001-Make-it-possible-to-include-files-over-https.patch
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
emoteJAM Elevator Pitch Document
View emoteJAM.md

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.

View main.py
#!/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 Mar 30, 2021
Simple dl example using SDL2 on Linux
View main.c
// $ 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
View main.c
// $ gcc `pkg-config --cflags libcurl` -o main main.c `pkg-config --libs libcurl`&& ./main
#include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
int main(void)
{
if (curl_global_init(CURL_GLOBAL_DEFAULT) != 0) {
fprintf(stderr, "ERROR: could not initialize global CURL state for some reason.\n");
View main.c
#include <stdio.h>
#define ROWS 10
#define COLS 10
typedef enum {
DEAD = 0,
ALIVE = 1,
} Cell;