Skip to content

Instantly share code, notes, and snippets.

@joefutrelle
joefutrelle / attiny85_synth.c
Last active July 26, 2022 16:10
Direct digital synthesis (Karplus-Strong plucked string algorithm) on the Atmel ATtiny85 AVR microcontroller using the MCP4725 12-bit DAC over I2C using USI-based TWI as described in Application Note AVR310
/**
* Author: Joe Futrelle
* License: CC0 - Free as in freedom
*/
/**
* ATtiny85 direct digital synthesis
* using MCP4725 12-bit I2C DAC
* TWI is handled using Atmel's USI TWI implementation
* which is provided as part of Application Note AVR310
* http://www.atmel.com/Images/Atmel-2561-Using-the-USI-Module-as-a-I2C-Master_AP-Note_AVR310.pdf
@robu3
robu3 / index.html
Created August 2, 2013 17:07
Jawbone Up Spiral Visualization
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v3.min.js"></script>
<style>
body {
font-family: sans-serif;
}
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
if [ -f /usr/share/git-core/git-completion.bash ]; then
. /usr/share/git-core/git-completion.bash
fi
if [ -f /usr/share/git-core/git-prompt.sh ]; then
. /usr/share/git-core/git-prompt.sh
@katspaugh
katspaugh / README.md
Last active May 20, 2019 13:36
Yandex.Direct API client (see http://api.yandex.com/direct/)

Usage

Instantiate with a path to the directory containing the SSL certificate and key (issued by Yandex.Direct).

from directmanager import DirectManager

manager = DirectManager('~/.certificates')

manager.set_cid(2139432)

@katspaugh
katspaugh / animate.js
Created November 18, 2011 11:15
Animation with pluggable easing functions.
/**
* Usage:
*
* animate(document.querySelector('#animatedElement'), {
* styles: {
* height: {
* start : 100
* end : 300,
* units : 'px'
* }
@katspaugh
katspaugh / template.js
Created November 17, 2011 10:59
String.prototype.template
String.prototype.template = function (obj) {
return this.replace(
/{{(.+?)}}/g,
function (_, key) { return obj[key] }
)
}
@katspaugh
katspaugh / observer.js
Created July 22, 2011 12:23
Minimal observer, needed too often.
var Observer = (function () {
'use strict';
return {
on: function (event, fn) {
if (!this.handlers) { this.handlers = {}; }
var handlers = this.handlers[event];
if (!handlers) {
handlers = this.handlers[event] = [];
@katspaugh
katspaugh / .vimrc
Created January 18, 2011 01:04
Alphabetically sorted!
set encoding=utf-8 fileencodings=utf-8
syntax on
"syntax sync fromstart
let no_buffers_menu=1
set backspace=indent,eol,start
set history=50
set hlsearch
set incsearch