Skip to content

Instantly share code, notes, and snippets.

View lericson's full-sized avatar
🎺
Doot doot

Ludvig Ericson lericson

🎺
Doot doot
View GitHub Profile
@lericson
lericson / _main.py
Last active August 29, 2015 14:05 — forked from andreif/_main.py
# coding=utf-8
import ctypes
import ctypes.util
from coreaudio import (
AudioObjectPropertyAddress,
kAudioHardwarePropertyDefaultInputDevice,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster,
kAudioObjectSystemObject,
AudioDeviceID,
@lericson
lericson / timed_code.py
Last active July 9, 2018 05:54 — forked from cgoldberg/timer.py
Python Timer Class - Context Manager for Timing Code Blocks
import logging
from contextlib import contextmanager
from timeit import default_timer
time_logger = logging.getLogger(__package__ + ".timer")
@contextmanager
def timed_code(name=None):
next_unit = iter(("s", "ms", "ns", "us")).next
msg = "section %s took" % (name,) if name else "section took"
@lericson
lericson / hack.sh
Created March 31, 2012 16:12 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2266437/hack.sh | sh
#