Skip to content

Instantly share code, notes, and snippets.

View maruel's full-sized avatar
🐢
Deleting PiB of data.

M-A maruel

🐢
Deleting PiB of data.
View GitHub Profile
import "fmt"
func main() {
fmt.Printf("Hello World..\n");
}
// next returns the next paths that can be used to make progress.
// Look at top, left, right, down, skipping 'from' and returns all the possibilities.
func (c *Canvas) next(at, from image.Point) []image.Point {
}
@maruel
maruel / gist:6d2002195c1199b8a1f1c0039eff0a55
Created November 1, 2016 13:43
halloween 2016 dlibox animations
#### IDLE
## Tree: Orange stars
{
"C": "#ff9000",
"_type": "NightStars"
}
@maruel
maruel / gist:f417e65b13ff9e99015c9191bfa33660
Created December 12, 2016 01:33
Christmas lights simple
{
"Curve": "ease-out",
"Patterns": [
{
"Child": {
"Frame": "L00001f1f1f1f",
"_type": "Repeated"
},
"MovePerHour": 21600,
"_type": "Rotate"
@maruel
maruel / Instructions
Created January 2, 2017 03:38
systemd files to enable SPI on startup on a C.H.I.P.
- Create the two files enable_spi.service and enable_spi.timer in /etc/systemd/system/
- Run the following:
sudo systemctl daemon-reload
sudo systemctl enable enable_spi.timer
sudo systemctl start enable_spi
/dev/spidev32766.0 should now be visible.
@maruel
maruel / gist:544cb4266a1c844383c2972900e42ff9
Created August 2, 2017 23:43
Raw and brotli+gzip compressed files
maruel@periph-io /var/lib/docker/web/periph.io/www $ stat -c "%6s %n" $(find ./ -type f -name "*.html*" | sort)
69 ./apps/examples/index.html
55 ./apps/examples/index.html.br
85 ./apps/examples/index.html.gz
78 ./apps/index.html
59 ./apps/index.html.br
92 ./apps/index.html.gz
23291 ./device/apa102/index.html
5622 ./device/apa102/index.html.br
6559 ./device/apa102/index.html.gz
@maruel
maruel / pwm.go
Created December 10, 2017 03:18
Creates two PWMs with different duty cycless using periph.io
package main
import (
"log"
"os"
"os/signal"
"time"
"periph.io/x/periph"
"periph.io/x/periph/conn/gpio"
@maruel
maruel / Results on go 1.10.1 amd64
Created April 11, 2018 14:54
Benchmarking functions
$ go test -bench=.
goos: linux
goarch: amd64
pkg: foo
BenchmarkAnonymousFunction-32 2000000000 0.86 ns/op
BenchmarkClosure-32 1000000000 2.26 ns/op
BenchmarkNormalFunction-32 2000000000 0.78 ns/op
BenchmarkNormalFunctionNotInline-32 500000000 2.34 ns/op
BenchmarkReturnedFunction-32 1000000000 2.36 ns/op
PASS
@maruel
maruel / keybase.md
Created April 5, 2019 18:47
keybase.md

Keybase proof

I hereby claim:

  • I am maruel on github.
  • I am maruel (https://keybase.io/maruel) on keybase.
  • I have a public key whose fingerprint is 1073 4F99 C193 E7EA 1FEC 6956 354C 0048 D089 FD48

To claim this, I am signing this object:

package main
import (
"crypto/sha1"
"crypto/sha256"
"crypto/sha512"
"fmt"
"hash"
"testing"