I hereby claim:
- I am deleted on github.
- I am leted (https://keybase.io/leted) on keybase.
- I have a public key ASAkKaNeWPqzKVo7rC2QqIlPr-TKYQPL2S2XosWvX6018Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
package db | |
import ( | |
"database/sql" | |
"log" | |
_ "github.com/mattn/go-sqlite3" // registers sqlite driver | |
gorp "gopkg.in/gorp.v1" | |
) |
// vim:set ft=c: | |
HardwareSerial uart = HardwareSerial(); | |
int LED_PIN = 11; | |
int counter = 0; | |
void setup(){ | |
uart.begin(19200); | |
Serial.begin(19200); | |
} |
import time | |
import vidplay | |
import os | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(4, GPIO.IN) | |
GPIO.setup(22, GPIO.IN) | |
GPIO.setwarnings(False) | |
vidplayer = vidplay.Vidplay() |
#include <avr/interrupt.h> | |
#include <avr/pgmspace.h> | |
#define bit(A) (1 << A) | |
#define sbi(p,b) { p |= (unsigned char)bit(b); } | |
#define cbi(p,b) { p &= (unsigned char)~bit(b); } | |
#define tbi(p,b) { p ^= (unsigned char)bit(b); } | |
#define gbi(p,b) (p & (unsigned char)bit(b)) | |
//#define BENCHMARK |
def statRecursive(node, isRoot=True): | |
for subnode in node.subnodes: | |
if subnode.isDirectory: | |
statRecursive(subnode, False) | |
else: | |
GlobalHandler.trigger('result', stat(subnode)) | |
if isRoot: | |
GlobalHandler.trigger('end_recursion') |
# An implementation of http://docs.python.org/2/library/string.html#format-specification-mini-language | |
# WARNING: Not complete. | |
applyFormat = (value, formatSpec) -> | |
pattern = /// | |
([^{}](?=[<>=^]))?([<>]^)? # fill & align | |
([\+\-\x20])? # sign | |
(\#)? # integer base specifier | |
(0)? # zero-padding | |
(\d+)? # width |
# Create a deep copy of an object. - Based on https://github.com/documentcloud/underscore/pull/595 | |
deepClone = (obj) -> | |
if !_.isObject obj or _.isFunction obj then return obj | |
if _.isDate obj then return new Date do obj.getTime | |
if _.isRegExp obj then return new RegExp obj.source, obj.toString().replace(/.*\//, "") | |
isArr = _.isArray obj or _.isArguments obj | |
func = (memo, value, key) -> | |
if isArr then memo.push deepClone value |
from datetime import date | |
def phase(m, d, y): | |
ref_date = date(2012, 1, 23) | |
our_date = date( y, m, d ) | |
date_delta = our_date - ref_date | |
days = date_delta.days | |
phase_length = 29.53 | |
return days % phase_length / phase_length |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Wages vs. Number of Jobs</title> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script> | |
<style type="text/css"> | |
body { | |
margin: 0; |