Skip to content

Instantly share code, notes, and snippets.

@turingbirds
turingbirds / invoke.py
Last active Aug 29, 2015
Execute a child program in a new process
View invoke.py
#!/usr/bin/python
# -*- 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
turingbirds / upload.php
Last active May 30, 2019
a simple php upload script
View upload.php
<?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 user.email "john_doe@example.com"
git config --global user.name "John Doe"