Skip to content

Instantly share code, notes, and snippets.

@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")
@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:

@bishboria
bishboria / springer-free-maths-books.md
Last active July 17, 2025 06:34
Springer made a bunch of books available for free, these were the direct links
@gafferongames
gafferongames / delta_compression.cpp
Last active April 28, 2025 22:48
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>
@commonsguy
commonsguy / LICENSE
Last active July 22, 2024 13:10
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,