Skip to content

Instantly share code, notes, and snippets.

View Mumakil's full-sized avatar

Otto Vehviläinen Mumakil

View GitHub Profile
@Mumakil
Mumakil / keybase.md
Created April 7, 2014 10:44
Keybase proof

Keybase proof

I hereby claim:

  • I am mumakil on github.
  • I am mumakil (https://keybase.io/mumakil) on keybase.
  • I have a public key whose fingerprint is 85FB C164 0D35 0B13 4EAD E608 E0DD A872 F7F8 EA63

To claim this, I am signing this object:

@Mumakil
Mumakil / flowdock-oauth.rb
Last active August 29, 2015 14:08
Generate Flowdock oauth token
#!/usr/bin/env ruby
begin
require 'oauth2'
rescue LoadError
puts "You need to install oauth2 gem, run `gem install oauth2`"
exit 1
end
require 'uri'
require 'net/http'
@Mumakil
Mumakil / README.md
Last active August 29, 2015 14:16
Redis expire notification test

Redis expire test

Test script to check how redis expire registration works.

Running

Run with npm run.

@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) {
@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 / .gitignore
Last active August 29, 2015 14:24
Echo server
node_modules/
@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 / 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 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 / error-handler.coffee
Last active May 25, 2016 10:10
Hubot helper scripts
# Add to hubot's scripts/ when developing hubot scripts in flowdock
# to enable easy debugging when errors happen. Posts all errors with stack
# traces to first flow it knows about.
module.exports = (robot) ->
if process.env.NODE_ENV == 'development'
robot.on 'error', (error) ->
errorMessage = "ERROR:\n"
if error.stack?
errorMessage += error.stack