Skip to content

Instantly share code, notes, and snippets.

Actively recommending people not to use WordPress!

Michael Bøcker-Larsen mblarsen

Actively recommending people not to use WordPress!
View GitHub Profile
mblarsen /
Created Oct 24, 2020
Small script so showcase all fonts for figlet and toilet
#!/usr/bin/env bash
for f in $(ls /usr/share/figlet/*{flf,tlf}); do
f=$(basename -s .tlf $f)
f=$(basename -s .flf $f)
figlet -f $f $f
toilet --gay -S -f $f $f
echo $f
mblarsen /
Last active May 14, 2019
zsh: fix command not found: _mv
rm -f ~/.zcompdump*
exec zsh -l
mblarsen / example.go
Last active Apr 19, 2019
A small CLI wrapper + Go test wrapper for @serverless/event-mocks
View example.go
func TestHandler(t *testing.T) {
req := api.Req{}
reqBody, _ := json.Marshal(map[string]interface{}{
"requestContext": map[string]interface{}{
"Authorizer": map[string]interface{}{
"claims": map[string]interface{}{
"cognito:username": "my user",
mblarsen /
Created Apr 17, 2019
Query buildkit builds for changes since last
#!/usr/bin/env bash
set -euo pipefail
function builds() {
curl -s \
-H "Authorization: Bearer $GRAPHQL_KEY" \
-d '{
"query": "query SuccessfullBuilds { pipeline(slug: \"'"$BUILDKITE_ORGANIZATION_SLUG/$BUILDKITE_PIPELINE_SLUG"'\") { builds { edges { node { id commit message state } } } } }",
"variables": "{ }"

Keybase proof

I hereby claim:

  • I am mblarsen on github.
  • I am mblarsen ( on keybase.
  • I have a public key ASDazMiuoLmVqtEF123TAjZvE7S47WTshQTiHzeg1-H7lAo

To claim this, I am signing this object:

mblarsen / array.js
Created Mar 1, 2018
Array.prototype extensions
View array.js
Object.defineProperty( // eslint-disable-line
Array.prototype, 'flatMap', {
value: function (mapFunction) {
Object.defineProperty( // eslint-disable-line
Array.prototype, 'tap', {
mblarsen / SourceText.vue
Created Nov 13, 2017
Vue Editor Tutorial - Step 1 - SourceText.vue
View SourceText.vue
<div class="source-text">
<div class="source-text__code" ref="content" @input="throttledUpdate" contenteditable="true" spellcheck="false"></div>
<div class="has-text-left">
<button @click="$emit('input', '')" class="button is-success">Clear</button>
import {debounce} from 'lodash-es'
mblarsen / App.vue
Last active Nov 13, 2017
Vue Editor Tutorial - Step 1 - App.vue
View App.vue
<div class="split">
<div class="split__item">
<cms-page v-model="content"></cms-page>
<source-text v-model="content"></source-text>
<div class="split__item">
<front-page v-model="content"></front-page>
mblarsen / package.json
Last active Nov 9, 2017
gitschwifty package.json scripts
View package.json
"scripts": {
"begin": "git reset --hard start",
"complete": "git reset --hard complete",
"previous": "git reset --hard complete",
"next": "git reset --hard $(git describe --tags)",
"reset": "git reset --hard $(git describe --tags)",
"current": "echo \"You are at step \"$(git describe --tags)"
View main.js
import Vue from 'vue'
import Acl from 'vue-browser-acl'
Vue.use(Acl, user, (acl) => {
acl.rule(view, Post)
acl.rule([edit, delete], Post, (user, post) => post.userId ===
acl.rule('moderate', Post, (user) => user.isModerator())