Skip to content

Instantly share code, notes, and snippets.

View roelofr's full-sized avatar
It's not a bug, it's an experience!

Roelof roelofr

It's not a bug, it's an experience!
View GitHub Profile
@roelofr
roelofr / README.md
Last active January 31, 2021 14:21
Find valid Bahrain postal ranges

Find Bahrain (BH) postal ranges

This snippet, to be run in your devtools, finds all numbers in the table on this page and finds the largest overlaps in an $O(N)$ fashion.

Bahrain postal codes have a XYY or XXYY format, where X is the municipality and Y is the locality.

Results are printed as info messages. Debug info is grouped.

@roelofr
roelofr / random-wallpaper.md
Last active August 9, 2021 07:50
A collection of useful scripts

Random Wallpapers

This is a script for Ubuntu that sets a random wallpaper whenever you invoke it, and works from cronjobs, so you can do cool stuff like cycle your wallpaper every 30 minutes:

Installation

Just download the random-wallpaper.sh and put it somewhere. I'd recommend $HOME/bin, but you can put it anywhere and then chmod u+x it.

@roelofr
roelofr / README.md
Last active December 5, 2019 15:03
Fixes for Statamic and PHP 7.4

Fixes for Statamic and PHP 7.4

These are fixes to get Statamic to work on PHP 7.4.

Statamic version: 2.11.15
PHP version: 7.4.0

@roelofr
roelofr / keybase.md
Created June 11, 2018 13:33
Keybase validation

Keybase proof

I hereby claim:

  • I am roelofr on github.
  • I am roelofr (https://keybase.io/roelofr) on keybase.
  • I have a public key ASBtgimazD8g8N8psVtl2V-a5R4zE5kbw0L7yNlQ2HUrygo

To claim this, I am signing this object:

@roelofr
roelofr / quick-match.js
Last active January 23, 2017 17:55
Gogs or GitTea to GitHub Helper
/**!
* Quickly matches all gogs / gitea teams to the groups in your list. Adds a
* number of exlamation marks if nothing matches.
*
* @license GPL-3.0
*/
(function($) {
'use strict';
var count = 0;
@roelofr
roelofr / reclaim-windows-10.ps1
Last active June 3, 2020 06:53
Reclaim windows 10 by removing Microsoft's crapware and changing common settings to be more secure (such as disabling autoplay). Sourced from https://gist.github.com/alirobe/7f3b34ad89a159e6daa1 .
# #########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Original Version: 1.4, 2016-01-16
# Tweaked based on personal preferences for @alirobe 2016-03-23 - v1.4.1
# NOTE: MAKE SURE YOU READ THIS SCRIPT CAREFULLY BEFORE RUNNING IT + ADJUST COMMENTING AS APPROPRIATE
# This script will reboot your machine when completed.
# #########
# Ask for elevated permissions if required
@roelofr
roelofr / format.php
Created July 29, 2016 13:28
PHP project config organizer
#!/usr/bin/env php
<?php
/**
* This script will organize JSON files. Initially only by alphabetical order but for certain files
* standards exist, which will be maintained.
*
* @author Roelof Roos <github@roelof.io>
* @license GPL-3.0
* @see https://gist.github.com/roelofr/b4180594ca61767556d2f33496ff4bbc
* @see https://gist.github.com/roelofr
@roelofr
roelofr / designer.html
Created October 18, 2014 22:41
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;