Skip to content

Instantly share code, notes, and snippets.

View omern1's full-sized avatar

Nabeel Omer omern1

  • Sony Interactive Entertainment
  • ~
  • 13:35 (UTC +01:00)
View GitHub Profile
@omern1
omern1 / build.sh
Created March 19, 2024 10:34 — forked from mlabbe/build.sh
Use clang linker --wrap to wrap a function in the same compilation unit
#!/bin/sh -x
CC=clang-9
rm -f *.o wrap nowrap
# build without wrapping
$CC -c wrap.c -o wrap.o
$CC -c wrap_b.c -o wrap_b.o
$CC wrap.o wrap_b.o -o nowrap
@omern1
omern1 / ANSI.md
Created February 22, 2024 14:52 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@omern1
omern1 / pdlsym.c
Created January 1, 2023 01:37 — forked from resilar/pdlsym.c
dlsym() for remote processes
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ptrace.h>
#include <sys/types.h>
#include <unistd.h>
struct elf {
@omern1
omern1 / 55-bytes-of-css.md
Created October 2, 2022 10:53 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@omern1
omern1 / llvmclangcmds.md
Created March 2, 2022 17:20 — forked from aqjune/llvmclangcmds.md
Useful clang/opt options
@omern1
omern1 / linkers.md
Created September 9, 2020 12:51 — forked from jvns/linkers.md
Notes on linkers
@omern1
omern1 / sleep_sort.rs
Last active May 23, 2021 10:19
A naive implementation of a strange sorting algorithm
//https://twitter.com/fermatslibrary/status/937687947041701888
use std::{thread, time};
use std::sync::{Arc, Barrier};
fn main() {
let elements = vec![9,8,7,6,5,4,3,2,1,0];
sleep_sort(elements);
}
fn sleep_sort(dataset: Vec<i32>) {