Skip to content

Instantly share code, notes, and snippets.

View run_subprocess.c
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
dpryden /
Created Jan 15, 2019
Demo of a RESTful API server in Python using only the standard library.
#!/usr/bin/env python3
"""Demo of a RESTful API server in Python, using only the standard library.
The API here is extremely simple:
* a POST request stores a JSON object (from the POST body) at the given path
* a GET request returns a JSON object stored at the given path
Example usage:
dpryden / toxin
Created Apr 3, 2018
toxin: Script for running python or shell commands inside a .tox environment
View toxin
# Run a command inside a Tox environment
if ! [[ -d .tox ]]; then
echo 'Cannot find .tox in this directory!'
exit 1
if [[ "$1" == '-e' ]]; then
shift 2
dpryden /
Created Oct 20, 2014
Example of a ClassLoader leak in Java
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
* Example demonstrating a ClassLoader leak.
* <p>To see it in action, copy this file to a temp directory somewhere,