Skip to content

Instantly share code, notes, and snippets.


Stefan Wallin StefanWallin

View GitHub Profile
StefanWallin / LICENSE.txt
Last active Mar 22, 2020
Mocking the Bunny gem and avoiding undetected calls to it
View LICENSE.txt
MIT License
Copyright (c) 2015 - present Stefan Wallin
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

Keybase proof

I hereby claim:

  • I am stefanwallin on github.
  • I am stefan_wallin ( on keybase.
  • I have a public key ASCt8QiLBDzHRzjy0V0PvNTeOqG_lW_eFB8lv-YkPpmptgo

To claim this, I am signing this object:

StefanWallin /
Created Jan 29, 2020
Atom-Beautify-asdf-rubocop Debuggin
View anySuccessfulPromise.js
export default class AnySuccessfulPromise {
constructor(promises) {
this.promises = promises;
this.successes = [];
this.errors = [];
this.thenCallbacks = [];
this.catchCallback = () => {
console.error("catch not defined");
this.finallyCallbacks = [];
StefanWallin / anyPromise.js
Created Oct 4, 2018
A quick implementation of Promise.any that does not modify the Promise prototype
View anyPromise.js
class AnyPromise {
constructor(promises) {
this.promises = promises;
this.successes = [];
this.errors = [];
this.thenCallback = () => { console.error('then not defined'); };
this.catchCallback = () => { console.error('catch not defined'); };
this.finallyCallback = () => {};
StefanWallin /
Last active Jun 5, 2017
Swedens Regions with Municipalities 2017

Swedens Regions with Municipalities 2017


The hierarchic relation between regions(län) and municipalities(kommuner) represented as JSON. It's derived from the SCB(The Swedish Central Board of Statistics) XLS-file at as it existed on 2017-06-05.

Svenska (Swedish)

Den hierarkiska strukturen mellan län och kommuner representerad som JSON. Den är skapad utifrån SCB's XLS-fil på

StefanWallin / menu.html.erb
Created Dec 9, 2015
Recursive cells — is it possible?
View menu.html.erb
<%= render_cell(:menu, :show, { contents: @menu_content }) %>
View Post Upgrade to El Capitan, with Homebrew &

Post Upgrade to El Capitan, with Homebrew & Ruby

... and Xcode and Java, etc.


If you don't already have homebrew installed, do that first, so you don't have to deal with SIP issues. Install all Software Updates available in the Apple Menu, up to and including El Capitan.


StefanWallin / plugin_name.js
Created Oct 8, 2015
Javascript jQuery namespaced functionality nugget
View plugin_name.js
document.mittmedia = document.mittmedia || {};
(function(object, jQuery, ...dependencies...){
object.plugin_name = {
elements: {
init: function(){
gatherElements: function(){
View 20150903153455_add_flags_to_human.rb
class AddFlagsToHuman < ActiveRecord::Migration
def change
# Add the flags
add_column :humen, :signed_up, :boolean, default: false
add_column :humen, :welcome_email_sent, :boolean, default: false
# Set the flags values
reversible do |dir|
dir.up do do |human|