Skip to content

Instantly share code, notes, and snippets.

turingbirds /
Last active Aug 29, 2015
Execute a child program in a new process
# -*- coding: utf-8 -*-
"""Execute a child program in a new process"""
import os
import subprocess
def exec_binary(cmd_line_list, cwd=None, stdout=None, stderr=None, verbose=False):
"""Invoke an executable file.
turingbirds / upload.php
Last active May 30, 2019
a simple php upload script
View upload.php
header("Content-Type: text/html; charset=utf-8");
function display_filesize($filesize) {
if (is_numeric($filesize)) {
$decr = 1024;
$step = 0;
$prefix = array('Byte','KB','MB','GB','TB','PB');
View Git cheatsheet.markdown

Git cheatsheet

Set up Git

git config --global ""
git config --global "John Doe"