Skip to content

Instantly share code, notes, and snippets.

View SpotlightKid's full-sized avatar

Christopher Arndt SpotlightKid

View GitHub Profile
#!/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()
@SpotlightKid
SpotlightKid / aurinfohelper.sh
Last active August 29, 2015 14:00
Generate .AURINFO file, create Arch source package and add .AURINFO to it
#!/bin/bash
#
# aurinfohelper.sh
#
process() {
if [ ! -f PKGBUILD ]; then
echo "PKGBUILD not found!"
else
source PKGBUILD
@SpotlightKid
SpotlightKid / bobp-python.md
Last active December 2, 2015 20:39 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is always better than functionality." - Pieter Hintjens
@SpotlightKid
SpotlightKid / synth.cpp
Created January 17, 2016 21:21 — forked from genericpenguin/synth.cpp
Arduino Synth
/* 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
@SpotlightKid
SpotlightKid / README.md
Last active September 22, 2017 07:47 — forked from yloiseau/watson-notify
Watson desktop notifier (Python)

Requirements

Indirect dependencies in parentheses:

  • python-notify2 (python-dbus, python-gi)
  • python-arrow (python-dateutil)
  • Watson (click)

Installation

@SpotlightKid
SpotlightKid / O2.ino
Created February 20, 2016 20:53 — forked from anonymous/O2.ino
// 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>
@SpotlightKid
SpotlightKid / dspD8.ino
Created February 20, 2016 21:02 — forked from anonymous/dspD8.ino
The dsp-D8 drum synthesizer
// 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>