Skip to content

Instantly share code, notes, and snippets.

@jochasinga
jochasinga / db.go
Last active August 29, 2015 14:17
Database Adapter Functions for blog API
package main
import (
"fmt"
"time"
"encoding/json"
"strconv"
"github.com/garyburd/redigo/redis"
)
@jochasinga
jochasinga / main.go
Created March 16, 2015 14:30
Main function for Blog API
package main
import (
"log"
"net/http"
)
func main() {
router := NewRouter()
@jochasinga
jochasinga / piproc.txt
Created April 10, 2015 05:32
Raspberry Pi 2 model B /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5
@jochasinga
jochasinga / alsa-base.conf
Created April 27, 2015 12:45
Using USB audio as the first sound card in Raspberry Pi
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7
# Cause optional modules to be loaded above generic modules
@jochasinga
jochasinga / simple_oscrcv.ck
Created April 27, 2015 12:54
Simple OscRecv test in Chuck
// Create an OscRecv object, which becomes undefined on Chuck 1.2.0.8 armhf
OscRecv orcv;
// Tell the OscRecv object the port
8081 => orcv.port;
// Tell the OscRecv object to start listening
orcv.listen();
orcv.event("/note", "C") @=> OscEvent c;
@jochasinga
jochasinga / extend.scss
Last active August 29, 2015 14:21
Simple html
body {
p {
@include special-text("Open Sans", $my-devilish-red, 22px, 1.5em);
}
// A heading you want to be in "Open Sans", devilish red but not 22px and 1.5em in line-height
h1 {
@extend p
font-size: initial; // use default font-size for h1
line-height: 2em;
}
## When you begin working on a feature
Step 1: Update the main (demo) branch
git checkout demo
git pull origin demo
Step 2: Create a feature branch off of the main branch (demo)
git checkout -b my_feature_branch demo
Step 3: Record/Commit your work
@jochasinga
jochasinga / edlabpost.html
Created July 9, 2015 16:55
A snippet of a node from the Edlab blog
<div class="node">
<div class="page-sub">
<div class="flex-title">
<a href="/index.php?q=node/12231">
Learn to Hack with Google Gruyere
</a>
</div>
</div>
<small>
Submitted by
#!/usr/bin/env python
import urllib2
import os
import re
from collections import deque
from bs4 import BeautifulSoup
base_url = "http://edlab.tc.columbia.edu/index.php?q=blog"
url_suffix = "&page={}"
@jochasinga
jochasinga / animal.py
Created July 29, 2015 17:15
Simple example class in Python
#!/usr/env/bin python
import time
class Animal(object):
_tired = False
_pace = 1
def __init__(self, legs, kingdom):
self.legs = legs