A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is always better than functionality." - Pieter Hintjens
#!/bin/sh | |
# Inits a project made with the django-cms-boilerplate | |
# Requires virtualenvwrapper and pip | |
# Create virtualenv if no active | |
if [ "$VIRTUAL_ENV" == "" ]; then | |
echo "Creating virtualenv... Name?" | |
read venvname | |
source virtualenvwrapper.sh | |
mkvirtualenv --no-site-packages $venvname | |
workon $venvname |
from contextlib import contextmanager | |
from time import time | |
from sys import stdout | |
@contextmanager | |
def duration(outfile=stdout): | |
start = time() | |
yield | |
end = time() | |
outfile.write(str(end - start) + '\n') |
from contextlib import contextmanager | |
from operator import itemgetter | |
from sys import argv, stdout | |
from time import time | |
@contextmanager | |
def duration(outfile=stdout): | |
start = time() | |
yield | |
end = time() |
#!/bin/bash | |
# | |
# aurinfohelper.sh | |
# | |
process() { | |
if [ ! -f PKGBUILD ]; then | |
echo "PKGBUILD not found!" | |
else | |
source PKGBUILD |
/* Arduino Synth from | |
https://janostman.wordpress.com/2016/01/15/how-to-build-your-very-own-string-synth/ | |
*/ | |
#include <avr/interrupt.h> | |
#include <avr/io.h> | |
#include <avr/pgmspace.h> | |
#ifndef cbi | |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) | |
#endif | |
#ifndef sbi |
// O2 Minipops rhythm box (c) DSP Synthesizers 2016 | |
// Free for non commercial use | |
// http://janostman.wordpress.com | |
#include <avr/interrupt.h> | |
#include <avr/io.h> | |
#include <avr/pgmspace.h> |
// dsp-L8 Latin Perc Chip (c) DSP Synthesizers 2015 | |
// Free for non commercial use | |
// http://janostman.wordpress.com | |
#include <avr/interrupt.h> | |
#include <avr/io.h> | |
#include <avr/pgmspace.h> | |
// dsp-D8 Drum Chip (c) DSP Synthesizers 2015 | |
// Free for non commercial use | |
// http://janostman.wordpress.com | |
#include <avr/interrupt.h> | |
#include <avr/io.h> | |
#include <avr/pgmspace.h> | |