Skip to content

Instantly share code, notes, and snippets.

@initzero
initzero / HowToOTGFast.md
Created May 24, 2016 20:20 — forked from gbaman/HowToOTGFast.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

###Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)
More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. Finally, open up the cmdline.txt. Be careful with this file, it is very picky with its formatting! Each parameter is seperated by a single

@initzero
initzero / consume.go
Last active August 29, 2015 14:13 — forked from larryli/consume.go
package main
import (
"fmt"
. "gist.github.com/9521299.git"
"github.com/kr/beanstalk"
"time"
)
func main() {
var editor = new Aviary.Feather({
// config
onSaveButtonClicked: function() {
// 1. start custom spinner and disable editor
editor.getImageData(function(data) { // `data` contains a base64 encoding of the image
// 2. POST `data` to your own server
// 3. stop custom spinner and enable or close the editor
});
return false; // prevents editor from following defautl save behavior
}
@initzero
initzero / output.txt
Last active August 29, 2015 14:10 — forked from freeeve/output.txt
wes-macbook:~ go run rowstojson.go
[
{
"id": 0,
"name": "Peck Duran",
"street": "Chapel Street",
"city": "Orbin",
"zip": "94999",
"state": "Maine",
"email": "ppppp@bbb.com",
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"