Skip to content

Instantly share code, notes, and snippets.

View Raphy42's full-sized avatar
🦀
🧪

MrKiwi Raphy42

🦀
🧪
  • 127.0.0.1
  • 05:27 (UTC +02:00)
View GitHub Profile
@Raphy42
Raphy42 / flatten.go
Created August 26, 2018 15:55
Flatten an arbitrary nested int array with go
package main
import (
"fmt"
"reflect"
)
// FlattenInt recursively flattens an arbitrary nested int array.
// Instead of defining an overly nested slice from the get-go (eg: [][][][][][][][]int)
// we are using an []interface{} and a type switch to resolve types at runtime.
@Raphy42
Raphy42 / shadok.js
Created July 18, 2017 17:07
Base 10 to shadok converter
const shadok = n => parseInt(n)
.toString(4)
.split('')
.map(e => ['ga', 'bu', 'zo', 'meu'][e])
.join(' ')