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 / deploy.yaml
Last active Aug 2, 2021
Solution for `git clone` using Ansible for repos with private submodules with github deploy keys
View deploy.yaml
# Problem:
# If you use git submodules linking two private github repos, you'll need to create a separate deploy key for each.
# Multiple keys are not supported by Ansible, nor does ansible (when running git module) resort to your `.ssh/config` file.
# This means your ansible playbook will hang in this case.
# You can however use the ansible git module to checkout your repo in multiple steps, like this:
- hosts: webserver
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
View knockout.subscribeChanged.js
* Knockout.js extension that gives both new and old value to
* subscription functions.
* Credit:
* Changed JBeagle's code to return a disposable subscription
* object so it conforms to subscribe()
ko.subscribable.fn.subscribeChanged = function (callback) {
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": "{ }"
mblarsen / app__Console__Commands__WebpackCommand.php
Last active Jun 11, 2018
Laravel and Webpack (with webpack-dev-server)
View app__Console__Commands__WebpackCommand.php
namespace Supawdog\Console\Commands;
use Illuminate\Console\Command;
use Symfony\Component\Process\ProcessUtils;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Process\PhpExecutableFinder;
class WebpackCommand extends Command
mblarsen / CodeSlot.vue
Last active May 19, 2018
WordPress style shortcodes in Vue
View CodeSlot.vue
/* Based on ideas described here: */
import 'babel-polyfill'
import { default as Tokenizer } from 'shortcode-tokenizer'
import Vue from 'vue'
import Row from 'components/ui/Row'
import Column from 'components/ui/Column'
import ProductList from 'components/content/ProductList'
import ProductCard from 'components/content/ProductCard'

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', {