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
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 <[email protected]>
//
// 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 September 22, 2024 12:24
TCC patch that enables including files via HTTPS using CURL
From 84c42091cbae3735c52e895221f3f95a87155756 Mon Sep 17 00:00:00 2001
From: rexim <[email protected]>
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
// $ 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");
#include <stdio.h>
#define ROWS 10
#define COLS 10
typedef enum {
DEAD = 0,
ALIVE = 1,
} Cell;
use std::ffi::{c_void, CStr, CString};
use std::os::raw::c_char;
const SDL_INIT_VIDEO: u32 = 0x00000020;
const SDL_WINDOW_RESIZABLE: u32 = 0x00000020;
const SDL_RENDERER_ACCELERATED: u32 = 0x00000002;
const SDL_QUIT: u32 = 0x100;
@rexim
rexim / if-label-paradox.md
Last active March 10, 2021 12:09
Quick Gist of the paradox we are trying to prevent in our assembly

The "If-Label" Paradox

In our assembly we are implementing the support for conditional translation:

%include "natives.hasm"
%const N 10
main:
    push 1
 push 2