Skip to content

Instantly share code, notes, and snippets.

View StefanWallin's full-sized avatar
🌍
💚

Stefan Wallin StefanWallin

🌍
💚
View GitHub Profile
@StefanWallin
StefanWallin / Mermaid.md
Created May 15, 2024 16:52
Mermaid rbac jwt
User --all requests--> LoadBalancer
LoadBalancer --authenticated requests--> jwtmiddleware
jwtMiddleware --get user--> DB
DB --user--> jwtMiddleware
jwtMiddleware --validJWTUser--> rbacMiddleware
rbacMiddleware --authorizedUser--> endpointHandler
endpointHandler --result--> User
@StefanWallin
StefanWallin / dockerdesktop2colima.md
Created February 1, 2022 07:03
Uppgradera från Docker Desktop till Colima

M1 Mac

Avinstallera Docker Desktop:

  • Välj Troubleshoot från menyn
  • Klicka på Uninstall valet i dialogen som dyker upp Installera colima
  • brew install docker
  • brew install colima
  • [[ $(uname -m) == "arm64" ]] && curl -L --create-dirs https://github.com/docker/buildx/releases/download/v0.7.1/buildx-v0.7.1.darwin-arm64 --output ~/.docker/cli-plugins/docker-buildx && chmod +x ~/.docker/cli-plugins/docker-buildx
  • chmod +x ~/.docker/cli-plugins/docker-buildx
  • colima start # Colima tar lång tid, 20 min typ har rapporterats, för mig tog det 2 minuter. ☕
@StefanWallin
StefanWallin / Sausage Gravy.md
Created November 26, 2021 18:51
Thanksgiving Recept på svenska

Sausage Gravy:

Portioner: 8 Total tid: 35 minuter Tillagningstid: 20 minuter

Ingredienser:

  • 500g Korv-innehåll
  • 4 matskedar mjöl
@StefanWallin
StefanWallin / LICENSE.txt
Last active March 22, 2020 10:11
Mocking the Bunny gem and avoiding undetected calls to it
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
@StefanWallin
StefanWallin / keybase.md
Created February 5, 2020 20:41
keybase.md

Keybase proof

I hereby claim:

  • I am stefanwallin on github.
  • I am stefan_wallin (https://keybase.io/stefan_wallin) on keybase.
  • I have a public key ASCt8QiLBDzHRzjy0V0PvNTeOqG_lW_eFB8lv-YkPpmptgo

To claim this, I am signing this object:

@StefanWallin
StefanWallin / debug.md
Created January 29, 2020 14:20
Atom-Beautify-asdf-rubocop Debuggin
@StefanWallin
StefanWallin / anySuccessfulPromise.js
Last active June 15, 2019 06:29
anySuccessfulPromise
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
StefanWallin / anyPromise.js
Created October 4, 2018 11:17
A quick implementation of Promise.any that does not modify the Promise prototype
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 = () => {};
this.awaitPromises();
}
@StefanWallin
StefanWallin / Readme.md
Last active June 5, 2017 18:54
Swedens Regions with Municipalities 2017

Swedens Regions with Municipalities 2017

English

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 http://www.scb.se/sv_/Hitta-statistik/Regional-statistik-och-kartor/Regionala-indelningar/Lan-och-kommuner/Lan-och-kommuner-i-kodnummerordning/ 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å http://www.scb.se/sv_/Hitta-statistik/Regional-statistik-och-kartor/Regionala-indelningar/Lan-och-kommuner/Lan-och-kommuner-i-kodnummerordning/

@StefanWallin
StefanWallin / menu.html.erb
Created December 9, 2015 14:53
Recursive cells — is it possible?
<%= render_cell(:menu, :show, { contents: @menu_content }) %>