Skip to content

Instantly share code, notes, and snippets.

View mdeboer's full-sized avatar
🤖
I may be slow to respond.

Maarten de Boer mdeboer

🤖
I may be slow to respond.
View GitHub Profile
@mdeboer
mdeboer / homebrew_pkgconfig.sh
Created November 17, 2020 15:34
Homebrew pkg-config paths
#!/bin/bash
#
# Echoes export statements for all pkgconfig paths of homebrew packages.
# You can echo the output directly to a file and source that.
#
# Usage:
# homebrew_pkgconfig.sh > .homebrew_pkgconfig && source ~/.homebrew_pkgconfig
#
@mdeboer
mdeboer / lightroom-rename.php
Created November 20, 2018 21:22
Lightroom renaming export action
#!/usr/bin/env php
<?php
/**
* Lightroom rename export action
*
* !! Please read carefully.
*
* This script is meant to be used with Lightroom as an export action. I wrote this script because I always rename my
* files on import using a specific format. When exporting however I want to replace a portion of the filename with the
@mdeboer
mdeboer / CVE-2017-8295.patch
Last active May 5, 2017 20:12
WordPress CVE-2017-8295 patch (proposal, needs testing)
--- a/wp-includes/pluggable.php 2017-03-10 16:06:34.000000000 +0100
+++ b/wp-includes/pluggable.php 2017-05-05 21:44:15.000000000 +0200
@@ -323,11 +323,8 @@
if ( !isset( $from_email ) ) {
// Get the site domain and get rid of www.
- $sitename = strtolower( $_SERVER['SERVER_NAME'] );
- if ( substr( $sitename, 0, 4 ) == 'www.' ) {
- $sitename = substr( $sitename, 4 );
- }
@mdeboer
mdeboer / gist:8854a2b48093c999fff8
Created July 19, 2014 18:00
X-Rite Hue color test cheat
function cheat(rowindex) {
var patches = document.querySelectorAll('.drag_container div[id^=patch_'+rowindex+'_]');
patches = Array.prototype.slice.call(patches);
patches.sort(function(a,b) {
var indexA = parseInt(a.id.substr(8));
var indexB = parseInt(b.id.substr(8));
if(indexA < indexB) {