Skip to content

Instantly share code, notes, and snippets.

View Mumakil's full-sized avatar

Otto Vehviläinen Mumakil

View GitHub Profile
@Mumakil
Mumakil / result
Created July 7, 2017 14:24
Performance difference between inline structs and global structs
# go test -bench .
BenchmarkInlineStruct-8 2000000000 0.37 ns/op
BenchmarkGlobalStruct-8 2000000000 0.30 ns/op
PASS
ok github.com/Mumakil/testing 1.476s
@Mumakil
Mumakil / nexa_lights_protocol.md
Last active November 1, 2022 15:54
Nexa 433MHz RF-light switch protocol reverse engineered

Nexa RF switch protocol reverse-engineered

I connected a 433MHz receiver directly to computer microphone port and powered it on (aka poor man's oscilloscope). Then I used Audacity to record at 48kHz the raw signal coming in and pressed the different buttons on the remote.

A sample of what a single broadcast looks like: https://www.dropbox.com/s/3hhdx8r5iyuurtk/Screenshot%202017-03-03%2008.05.27.png?dl=0

RF protocol

Resolution 48000 Hz - 1 sample is 20.83us

@Mumakil
Mumakil / .gitignore
Last active June 19, 2021 05:06
Luxafor Spotify integration
node_modules/*
STATE
@Mumakil
Mumakil / codes_to_languages.json
Last active September 7, 2017 11:52
ISO-639 language maps, codes to language and vice versa
{
"ab": "Abkhazian",
"abk": "Abkhazian",
"ace": "Achinese",
"ach": "Acoli",
"ada": "Adangme",
"ady": "Adyghe",
"aa": "Afar",
"aar": "Afar",
"afh": "Afrihili",
@Mumakil
Mumakil / README.md
Last active May 11, 2016 05:51
Helsinki Gophers May 2016 meetup Cgo code examples

Cgo Code examples

Helsinki Gophers May 2016 meetup

Building and running

go build -o demo .
./demo
@Mumakil
Mumakil / be.fish
Last active April 11, 2016 07:27
Fish functions
function be -d "Alias for `bundle exec`"
bundle exec $argv
end
@Mumakil
Mumakil / Readme.md
Last active January 14, 2016 06:38
Elevator saga engine http://play.elevatorsaga.com/

Elevator Saga program

My elevator control program for the elevator saga game.

Iterations

  1. Listen to all button presses and play them back in order.
  • Beat level 1.
  1. Add going up / down indicators and drive all the way to the specific direction.
  • Beat level 3.
@Mumakil
Mumakil / .gitignore
Last active August 29, 2015 14:24
Echo server
node_modules/
@Mumakil
Mumakil / stream.coffee
Created June 16, 2015 10:22
Streaming api cleanup example
class Stream extends process.EventEmitter
constructor: (@request, @response, @channels, @user) ->
# other initializing code
get: ->
# start streaming messages in response to a get request
# ...
# Normal cleanup after stream is closed
@Mumakil
Mumakil / array_lookup.js
Last active August 29, 2015 14:18
Javascript set benchmarks
var collectionCount = process.env['COLLECTIONS'] || 1000;
var perCollection = process.env['PER_COLLECTION'] || 1000;
var iterationCount = process.env['ITERATION_COUNT'] || 1000;
var collections = [];
var current, i, j, k, l, r;
for (i = 0; i < collectionCount; i += 1) {
current = [];
for (j = 0; j < perCollection; j += 1) {