Skip to content

Instantly share code, notes, and snippets.

Maarten de Boer mdeboer

View GitHub Profile
@mdeboer
mdeboer / lightroom-rename.php
Created Nov 20, 2018
Lightroom renaming export action
View lightroom-rename.php
#!/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
WordPress CVE-2017-8295 patch (proposal, needs testing)
View CVE-2017-8295.patch
--- 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 Jul 19, 2014
X-Rite Hue color test cheat
View gist:8854a2b48093c999fff8
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) {
You can’t perform that action at this time.