Skip to content

Instantly share code, notes, and snippets.

View kdrag0n's full-sized avatar
🔥
Putting out fires

Danny Lin kdrag0n

🔥
Putting out fires
View GitHub Profile
@kdrag0n
kdrag0n / bldgcc.sh
Created August 19, 2019 07:35
A script to build compact bare-metal toolchains with GCC and binutils. Thanks to @nathanchance for the base.
#!/usr/bin/env zsh
#
# Builds GCC and binutils for exclusively building kernels
#
# Modified by @kdrag0n for building compact toolchains.
# Thanks to Nathan Chancellor for the original bldgcc script:
# https://github.com/nathanchance/scripts/blob/master/funcs/bldgcc
#
# Example usage:
@kdrag0n
kdrag0n / Notes.md
Last active April 1, 2023 12:44
Android P semi-GSI notes
@msfjarvis
msfjarvis / sepolicy.md
Last active December 16, 2023 20:50
How to write sepolicy to fix a denial
@Coderlane
Coderlane / copy_lwjgl.sh
Last active December 24, 2019 05:27
Copy lwjgl binaries into the linux natives jar file for minecraft.
#!/bin/bash
# This script will copy the newly compiled lwjgl.so and libopenal.so
# from the specified directory into the correct minecraft jar file.
# It will then compute and update the correct sha1sum.
#
# First Arguement (Required):
# Path to the directory containing:
# lwjgl.so and libopenal.so
#
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@Kos
Kos / formats.txt
Last active January 28, 2024 02:47
OpenGL image formats along with their unsized variants and preferred formats for pixel transfer (Written by hand, needs verification) Pixel store for compressed textures not provided because there are glCompressedTexImage and family for them. EXT_texture_compression_s3tc formats not included.
| Image format (sized) | Unsized | Compr | Pixel format | Pixel type |
|---------------------------------------|--------------------|-------|--------------------|-----------------------------------|
| GL_R8 | GL_RED | False | GL_RED | GL_UNSIGNED_BYTE |
| GL_R8_SNORM | GL_RED | False | GL_RED | GL_BYTE |
| GL_R16 | GL_RED | False | GL_RED | GL_UNSIGNED_SHORT |
| GL_R16_SNORM | GL_RED | False | GL_RED | GL_SHORT |
| GL_R32F | GL_RED | False | GL_RED | GL_FLOAT |
| GL_R8I | GL_RED | False | GL_RED_INTEGER | GL_INT |
@jboner
jboner / latency.txt
Last active May 6, 2024 07:06
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD