Skip to content

Instantly share code, notes, and snippets.


Claus Wahlers claus

Block or report user

Report or block claus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
claus / flashforward.asm
Created Oct 16, 2019
6502 assembler intro for Flash Forward awards ceremony 2006 in Austin, Tx (FC64 emulator)
View flashforward.asm
; FC64 Flashforward Trailer
; =========================
; Basic: "1 SYS(2064)"
.a 0801
.b 0d,08,01,00,9e,28,32,30,36,34,29,00,00,00,00
claus / NextWorkboxPlugin.js
Last active Oct 15, 2019
Simple Webpack plugin to create Workbox based service workers for Next.js 9.1+ projects.
View NextWorkboxPlugin.js
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const readdir = require('recursive-readdir');
const SW_NAME = 'sw.js';
const fileBlacklist = [
claus /
Created Sep 11, 2018
MacOS: capture screenshot and add it to IPFS
# Exit on errors
set -e
set -o pipefail
# Filename of captured image
FILE="$(date +%Y-%m-%d-%H-%M-%S).png"
# User/host
# Capture screen (interactively) and save image to the desktop
screencapture -i ~/Desktop/$FILE
# Upload the captured image to the server
claus / functions.php
Created Aug 17, 2018
Wordpress: Also search tags in addition to post title and content
View functions.php
function tax_search_join( $join, $query ) {
global $wpdb;
if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) {
$join .= "
{$wpdb->term_relationships} ON {$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id
{$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id
{$wpdb->terms} ON {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id
claus /
Last active Apr 18, 2018
Data Prefetching in Next.js

Data Prefetching in Next.js


The Miroskii Team

(and who they really are)

Miroskii advisors and team screenshotted off, 2018-03-04 at 14.50.18 PST:

Miroskii advisors and team

"Craig Gulledge"


A while ago i needed a way to look up addresses from zip codes in Brazil for a weekend tinker project (Zip codes are called "CEP" here, "Código de Endereçamento Postal", or Postal Addressing Code). Turns out such a database is pretty hard to get hold of. Zip code data is created and maintained by the Brazilian Post (Correios), they have a copyright on it and are selling it for a hefty price tag. There are two versions for sale, "DNE Básico" for R$1.100 (complete dataset in text format, probably CSV), and "DNE Máster" for R$2.500. As far as i aware, the "Máster" version is just the same as the "Básico" version, but additionally contains the database in MS Access format. Okay, both are a bit above my budget.

Luckily there is another option, called "Guia Postal Brasileiro Eletrônico", or GPBe. This is an executable that you can run on your PC to manually query zip codes and addresses. And to be able to do that it must somehow contain the entire database in some form. It costs R$50, which is affordable (about US

View gist:7965d245347129940dde226b93d3386c
Verifying my Blockstack ID is secured with the address 18LbnFamubJd8mXjWS8WZta46XzHBmRLUC
claus /
Last active Oct 9, 2019
Host Your Site Under Your Domain on IPFS

Host Your Site Under Your Domain on IPFS

This is a step-by-step tutorial for hosting your website under your domain on IPFS, from zero, on a DigitalOcean Ubuntu 16.04.3 x64 Droplet (i am using the $10 variant with 2GB RAM).

Install IPFS

Log in as root.

First, make sure the system is up to date, and install tar and wget:


Mobile Safari's 100% Height Dilemma

Whether you're developing a web application with native-ish UI, or just a simple modal popup overlay that covers the viewport, when it comes to making things work on iDevices in Mobile Safari, you're in for a decent amount of pain and suffering. Making something "100% height" is not as easy as it seems.

This post is a collection of Mobile Safari's gotchas and quirks on that topic, some with solutions and fixes, some without, in good parts pulled from various sources across the internets, to have it all in one place. Things discussed here apply to iOS8, iOS9 and iOS10.

The Disappearing Browser Chrome

Screen real estate on smartphones is limited, so Mobile Safari collapses the browser chrome (address bar and optional tab bar at the top, and tool bar at the bottom) when the user scrolls down. When you want to make something span exactly the height of the viewport, or pin something to the bottom of the screen, this can get tricky because the viewport changes size (or

You can’t perform that action at this time.