Skip to content

Instantly share code, notes, and snippets.

View notexactlyawe's full-sized avatar

Cameron MacLeod notexactlyawe

View GitHub Profile
@notexactlyawe
notexactlyawe / .vimrc
Last active August 18, 2016 09:15
My vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'elixir-lang/vim-elixir'
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'vim-scripts/taglist.vim'
@notexactlyawe
notexactlyawe / whitenoise.py
Created July 5, 2017 09:28
Whitenoise generating snippet
import threading
import random
import Queue
import pyaudio
import numpy as np
SAMPLE_RATE = 44100
DURATION = 0.5
class WhitenoiseSound(threading.Thread):
@notexactlyawe
notexactlyawe / lsm303_to_pd.py
Last active April 20, 2018 09:46
Code to read the Adafruit LSM303 sensor and send the readings to Pure Data
""" Python file to demonstrate reading the LSM303 and pass data to Pure Data
Author: Cameron MacLeod
Date: 2018/03/17
Contact: github.com/notexactlyawe
"""
import time
import argparse
import Adafruit_LSM303
@notexactlyawe
notexactlyawe / satisfying.py
Created March 2, 2020 13:52
Prints a grid of '1's to your terminal and then slowly changes them to '0's
import random
import time
import shutil
width, height = shutil.get_terminal_size()
width = width // 2
grid = []
for row in range(height):
grid.append([1 for _ in range(width)])
@notexactlyawe
notexactlyawe / complex-toposort.py
Last active August 5, 2023 15:53
Example code for using Python's graphlib
"""More complex example with shared dependencies"""
from graphlib import TopologicalSorter
from dataclasses import dataclass
from typing import List
@dataclass
class Package:
name: str
depends_on: List[str]