Skip to content

Instantly share code, notes, and snippets.

@Silva97
Silva97 / get-function-size.c
Created July 11, 2021 15:45
Just an example of how to get the size of a function in bytes using the GCC compiler
// See how it's works using: gcc -S get-function-size.c -o get-function-size.s
// To manually check function size: objdump -d get-function-size
#include <stdio.h>
#define DECLARE_FUNCSIZE(funcname) \
extern unsigned int funcname##_funcsize; \
asm(#funcname "_funcsize: .long . - " #funcname "\n\t")
#define FUNCSIZE(funcname) \
funcname##_funcsize
@GetVladimir
GetVladimir / Force-RGB-Color-on-M1-Mac.md
Last active April 30, 2025 07:04
Force RGB Color on M1 Mac

Force RGB Color on M1 Mac

How to Force RGB Color Output instead of YPbPr on your M1 Apple Silicon Mac for an External Monitor.

This step-by-step video tutorial will guide you through the procedure of forcing RGB color output on your M1 Mac.

Force RGB Color on M1 Mac

Here is the direct link to the video tutorial: https://www.youtube.com/watch?v=Z1EqH3fd0V4

The video also has Closed Captions (Subtitles) that you can enable, to make it easier to follow if needed.

@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@shmup
shmup / torrents.md
Last active April 19, 2025 14:47
transmission blocklist guide

Transmission Blocklist

The Transmission torrent client has an option to set a Blocklist, which helps protect you from getting caught and having the DMCA send a letter/email.

It's as simple as downloading and installing the latest client:

@maddouri
maddouri / build-static-python.sh
Created December 6, 2015 22:42
A simple script that builds static versions of Python and LibPython using musl-libc
#!/bin/bash
# set -eux
# This a simple script that builds static versions of Python and LibPython using musl-libc
# Find the associated article at: http://general-purpose.io/2015/12/06/compiling-python-and-libpython-statically-using-musl-libc/
WORKING_DIR="/code/static-python"
MUSL_PREFIX="/code/static-python/musl"
PY_PREFIX="/code/static-python/python"