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
@rexim
rexim / Queue.org
Last active July 26, 2022 19:23
Friday Queue

Friday Queue

Current User: Just “Travis”

Use !friday command to put a video here (only for trusted and subs). Any video can be skipped if the streamer finds it boring.

0xgor

Video Count 2

@rexim
rexim / Help.org
Last active February 21, 2022 23:04
HyperNerd Commands
// Copyright 2019 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:
//
void rebuild_if_modified(int argc, char *argv[])
{
assert(argc > 0);
const char *binary = argv[0];
const char *source = __FILE__;
struct stat source_stat;
stat(source, &source_stat);
struct stat binary_stat;
@rexim
rexim / main.c
Created September 13, 2019 02:36
// gcc -nostdlib main.c
inline static
void write_syscall(int fd, const void *buf, unsigned int count)
{
asm("movq $1, %rax");
asm("syscall");
}
inline static
@rexim
rexim / Queue.org
Last active September 28, 2019 12:51
Test
@rexim
rexim / build.c
Created October 12, 2019 18:00
Self-hosted build tool
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <assert.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#define KILO 1024
#define MEGA (1024 * KILO)
#define ARENA_CAPACITY 16
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h> /* of course */
#include <X11/Xutil.h> /* duuuh */
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h> /* obviously */
@rexim
rexim / main.rs
Created December 31, 2019 21:48
use std::io::prelude::*;
fn epic_file_line_counter(file_path: String) -> std::io::Result<usize> {
let file = std::fs::File::open(file_path)?;
let buf_reader = std::io::BufReader::new(file);
Ok(buf_reader.lines().count())
}
fn virgin_single_threaded() {
std::env::args()