Skip to content

Instantly share code, notes, and snippets.

Last update: 5/18

C.H.I.P.

Just use nmtui.

RaspberryPis

On recent ubuntus (16.04+) with the new net interfaces mac rename thingy, disable it to get back to the old naming scheme with:

@uraimo
uraimo / pimoroni_unicornhat_nulsom_rainbow_matrix.markdown
Created March 5, 2016 20:46
Using the Pimoroni Unicorn Hat python library with a Nulsom 8x8 Led matrix

The Nulsom rainbow matrix is compatible with the Pimoroni unicorn hat Raspberry Pi library but needs a few modifications. Tested on a Raspberry 2.

Connections

Connect the matrix 5V and GND to the Raspberry, connect the DI pin to P18.

Modifications

Install the unicorn hat library with \curl -sS get.pimoroni.com/unicornhat | bash.

@uraimo
uraimo / jekyll3.diff
Created November 19, 2015 10:58
Diff of some required modifications for my site from jekyll 2.5.x to 3.x
diff --git a/Gemfile b/Gemfile
index f25308a..4b32b39 100644
--- a/Gemfile
+++ b/Gemfile
@@ -3,6 +3,7 @@ source "http://rubygems.org"
gem 'rake'
gem 'jekyll'
+gem 'jekyll-paginate'
gem 'rdiscount'
@uraimo
uraimo / sp-bootstrap2.css
Created November 13, 2014 15:06
Bootstrap 2 theme for bgrins/spectrum color picker button
.sp-boot2.sp-replacer {
margin:0;
overflow:hidden;
cursor:pointer;
padding: 4px;
display:inline-block;
*zoom: 1;
*display: inline;
border: solid 1px #dddddd;
background: #eee;
@uraimo
uraimo / notreallya_crawler.go
Last active December 18, 2015 07:58
A Tour Of Go: Web Crawler
package main
import (
"fmt"
"sync"
)
type StringArray []string
var urlmap StringArray= make([]string,1)
@uraimo
uraimo / binary_tree_equal.go
Created June 7, 2013 14:26
A Tour Of Go: Equivalent Binary Trees
package main
import (
"fmt"
"code.google.com/p/go-tour/tree"
)
// Walk walks the tree t sending all values
// from the tree to the channel ch.
func Walk(t *tree.Tree, ch chan int){
@uraimo
uraimo / rot13_reader.go
Last active December 18, 2015 03:58
A Tour of Go: Rot13 Reader
package main
import (
"io"
"os"
"strings"
)
type rot13Reader struct {
r io.Reader
@uraimo
uraimo / images.go
Created June 6, 2013 12:15
A Tour of Go #59: Images Exercise
package main
import (
"code.google.com/p/go-tour/pic"
"image"
"image/color"
)
func Sqrt(f int) int {
var z int = 1
@uraimo
uraimo / slices.go
Last active December 17, 2015 23:59
A Tour of Go: Slices exercise answer , added a factorial for a better picture
package main
import "code.google.com/p/go-tour/pic"
func Fact(x uint8) uint8 {
if x>1 {
return x * (x-1)
}
return x+1
}
@uraimo
uraimo / maps.go
Created June 2, 2013 09:46
A Tour of Go: Maps Exercise solution w/o strings.Fields
package main
import (
"code.google.com/p/go-tour/wc"
)
func WordCount(s string) map[string]int {
res := make(map[string]int);
str := make([]rune,0,10)
for _, r := range(s){