Skip to content

Instantly share code, notes, and snippets.

View BramEsposito's full-sized avatar
🌊

Bram Esposito BramEsposito

🌊
View GitHub Profile
<?php
for ($i=0;$i<20;$i++) {
print("032 ".ri().ri().ri()." ".ri().ri()." ".ri().ri()." ".ri().ri())."\n";
}
function ri() {
return rand(0,9);
}
?>
@BramEsposito
BramEsposito / backgroundimagesize.js
Created September 13, 2016 09:23
Run this script as a bookmarklet or in your console to detect if you have oversized background images on your page
(function() {
// the minimum version of jQuery we want
var v = "1.3.2";
// check prior inclusion and version
if (window.jQuery === undefined || window.jQuery.fn.jquery < v) {
var done = false;
var script = document.createElement("script");
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/" + v + "/jquery.min.js";
@BramEsposito
BramEsposito / generatepasswd.pl
Last active October 17, 2016 14:27
Generate a Dutch password following the XKCD philosophy
# /usr/bin/perl
# documentation: http://bbusschots.github.io/hsxkpasswd/Crypt-HSXKPasswd/pod.html
# install: sudo cpan Crypt::HSXKPasswd
use Crypt::HSXKPasswd;
use Crypt::HSXKPasswd::Dictionary::NL;
my $hsxkpasswd_instance = Crypt::HSXKPasswd->new(
@BramEsposito
BramEsposito / install new mac.sh
Created January 9, 2017 10:12
install script for new mac
echo "Enter your username: (for git usage)"
read UserName
echo "Enter your email address: (for git usage)"
read EmailAddress
# Ask for the administrator password upfront
sudo -v
echo "Installing xcode-stuff"
xcode-select --install
@BramEsposito
BramEsposito / MySQL_macOS_Sierra.md
Created January 16, 2017 20:26 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@BramEsposito
BramEsposito / dnsmasq OS X.md
Created January 16, 2017 20:40 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

Install

@BramEsposito
BramEsposito / mac-php-composer-setup.md
Created January 17, 2017 17:19 — forked from tomysmile/mac-php-composer-setup.md
Setup PHP Composer using Brew
@BramEsposito
BramEsposito / copy next line to clipboard
Created February 13, 2017 21:49
Copy next line to clipboard. Put this in an Alfred action and assign a shortcut.
FILE="/Users/user/wherever/you put/your files/file.txt"
head -n 1 "$FILE" | pbcopy
echo "$(sed '1d' "$FILE")\n" > "$FILE"
@BramEsposito
BramEsposito / install custom event handler.html
Last active November 29, 2017 14:20
Google Tag Manager: Custom event tracking
<script>
(function() {
$(".fully-clickable").on("click", function(event) {
dataLayer.push({
"event":"fullyclickable event",
"fully-clickable url": new URL($(event.target).find('a:last').attr('href'), window.location.href).href
});
});
})();
</script>
@BramEsposito
BramEsposito / 2018.06.05 - events-manager-patch.diff
Created June 14, 2018 13:58
patch Events Manager Wordpress plugin to allow [gallery] shortcode overrides
From 5ad8723a1b7acb8b04bbe38824f00b930b703293 Mon Sep 17 00:00:00 2001
From: Bram Esposito <[email protected]>
Date: Tue, 5 Jun 2018 14:22:00 +0200
Subject: [PATCH] patch events manager wrt gallery issues
---
wp-content/plugins/events-manager/classes/em-event.php | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/wp-content/plugins/events-manager/classes/em-event.php b/wp-content/plugins/events-manager/classes/em-event.php