Skip to content

Instantly share code, notes, and snippets.

@commonsguy
commonsguy / LICENSE
Last active December 11, 2022 16:33
deaar: Convert Android AAR Artifacts Into Library Projects
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
@gafferongames
gafferongames / delta_compression.cpp
Last active May 13, 2024 06:38
Delta Compression
/*
Delta Compression by Glenn Fiedler.
This source code is placed in the public domain.
http://gafferongames.com/2015/03/14/the-networked-physics-data-compression-challenge/
*/
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@CMCDragonkai
CMCDragonkai / linux_process_trees_and_process_hierarchy.md
Last active May 14, 2021 18:34
Linux: Linux/Unix Process Trees and Process Hierarchy

Linux/Unix Process Trees and Process Hierarchy

Sleep is an executable that we can use to simulate a blocking process for the purposes of demonstrating how to handle child processes.

Here's our base case.

The execution pattern is going to occur in this way: zsh (interactive) -> bash (./parent.sh) -> bash (./child.sh) -> sleep. Because both Bash processes performed an exec without fork, the bash (./parent.sh) process will be replaced by Bash (./child.sh), which itself will be replaced by sleep. This will mean that there are no child processes to manage except for the immediate child of sleep. Upon sending SIGINT, the sleep process will be terminated, and there will be no resource leak. No orphaned nor zombie processes.

./parent.sh:

@aallan
aallan / server_notcached.py
Created April 10, 2018 12:04
A non-caching version of Python's SimpleHTTPServer
#!/usr/bin/env python
import SimpleHTTPServer
class MyHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def end_headers(self):
self.send_my_headers()
SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self)
def send_my_headers(self):
self.send_header("Cache-Control", "no-cache, no-store, must-revalidate")
@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active May 4, 2024 00:19
Ubuntu and Debian Cloud images in Proxmox
@harold-b
harold-b / IntelGfxUbuntu20.04MacBookPro10-1.md
Last active April 6, 2024 17:49
Enable Intel Graphics on Ubuntu 20.04 on MacBook Pro Mid 2012 Retina (10,1)

How to get Intel graphics working on MacBook Pro mid 2012 (10,1) Ubuntu 20.04:

Ubuntu was intalled with the default nvidia drivers that it brought (I believe 3.90)

Clone https://github.com/0xbb/apple_set_os.efi

For details, see the README.md

Build it:

@Sunlighter
Sunlighter / README.md
Last active November 12, 2022 11:21
Installing .NET 5 in Amazon Linux 2 for ARM

Installing .NET 5 in Amazon Linux 2 for ARM64

This is a way to install .NET 5 in your home directory without modifying the system.

At the time of this writing, Amazon Linux 2 for ARM64 almost works already, but there is a problem with the ICU library. I will show this problem and how to fix it.

  1. Start Amazon Linux 2 and sign in. (I recommend an m6g.medium instance
@floooh
floooh / zig_test_debugging_vscode.md
Last active May 3, 2024 02:00
How to debug Zig tests in VSCode

Tested on macOS:

  1. Install the CodeLLDB VSCode extension. Unlike the debugger in the C/C++ extension, this allows to set breakpoints inside Zig "test" blocks (in the MS C/C++ extension debugger, breakpoints inside test blocks will be disabled once the debugger starts for unknown reasons.
  2. When compiling the test, tell it to also emit a binary: zig test -femit-bin=zig-out/bin/my-test src/bla.zig, otherwise there will be no executable to debug.
  3. The compiled test executable expects the path to the Zig executable as first command line argument, the launch.json file needs to be setup accordingly (note the args item):