Skip to content

Instantly share code, notes, and snippets.

View Bwooce's full-sized avatar

Bruce Fitzsimons Bwooce

  • Sydney, Australia
View GitHub Profile
#include "LoRaWan_APP.h"
#include <Region.h>
#include "Arduino.h"
// The interrupt pin is attached to D4
#define ACC_INT_PIN GPIO1
bool accelWoke = false;
DeviceClass_t CLASS = LORAWAN_CLASS;
@Bwooce
Bwooce / jpeg_intensity.go
Created April 25, 2014 08:33
Get the average and peak intensity (sum of r/g/b channels) of the centre 100x100px of an image.
package main
import (
"os"
"fmt"
"image/jpeg"
"bufio"
"log"
)
@Bwooce
Bwooce / Yudu ebook investigation.md
Last active January 3, 2016 18:19
Initial investigation into Pascal Press / Yudu eBook system.

This ebook system uses Adobe Flash to display. It has dedicated clients, per publisher (in this case Pascal Press) but the base technology and infrastructure is provided by Yudu.

Running the application and tracing the communications shows that the login user/pass is send in XML in cleartext. Hmmm. It then downloads the available books to display thumbnails and descriptions.

Downloading a specific, pre-purchased, file results in a manifest, multiple content files, and a text index file (presumably for full text search results). The content comes down as low-res jpegs, 1 per page, and CWF (Compressed Flash Data) files, also one per page. The files are served off AWS S3.

The ebook files are stored ~/Library/Application\ Support/com.yudu.ReaderAIR/Local\ Store/editions/

Under that directory, you get the following files (and one dir): content manifest preview.jpg thumbnail.jpg

@Bwooce
Bwooce / debug.go
Last active January 11, 2016 18:01
Go debug code from Rob Pike. Updated with a Println that works (thanks guelfey from #go-nuts)
const debug debugging = true // or flip to false
type debugging bool
func (d debugging) Println(args ...interface{}) {
if d {
log.Println(append([]interface{}{"DEBUG:"}, args...)...)
}
}
func (d debugging) Printf(format string, args ...interface{}) {
@Bwooce
Bwooce / pubsub.go
Created April 13, 2013 10:46
Pub/Sub example from Kyle Lemons. For further study as it contains a few new channel actions that I don't yet get.
package main
import "fmt"
const Buffer = 3
type Value int
type Producer struct {
subs map[chan Value]bool
@Bwooce
Bwooce / maxcpu.go
Created April 11, 2013 05:02
Use max cpu on any box
package main
import (
"runtime"
"fmt"
)
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
fmt.Println("Starting to use cpu on", runtime.NumCPU(), "cores")