Skip to content

Instantly share code, notes, and snippets.

View BramEsposito's full-sized avatar
🌊

Bram Esposito BramEsposito

🌊
View GitHub Profile
@BramEsposito
BramEsposito / cue_to_mp3.py
Last active December 29, 2024 19:51 — forked from bancek/cue_to_mp3.py
CUE splitter using ffmpeg (to mp3)
# Fixed version of https://gist.github.com/bancek/b37b780292540ed2d17d
import os
import sys
cue_file = sys.argv[1]
d = open(cue_file).read().splitlines()
general = {}
@BramEsposito
BramEsposito / slot-scope.html
Created July 6, 2023 12:50
How to refactor Vue2's deprecated slot-scope to the 2.6.0 syntax
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>slot-scope</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<style>
.oldcomponent,
.newcomponent {
@BramEsposito
BramEsposito / b35-http-auth.php
Last active March 18, 2021 13:23
HTTP AUTH for Wordpress (with getenv)
<?php
/**
* Plugin Name: B35 Http Auth
* Plugin URI: https://gist.github.com/BramEsposito/bbd5a6a03b2ce5dcda33f4a4827187b0
* Description: Disable unauthenticated access to your site
* Author: Bram Esposito
* Version: 1.0
* Author URI: https://bramesposito.com
*
@BramEsposito
BramEsposito / Dark mode detection with toggle.html
Created June 29, 2019 09:01
Dark mode detection with toggle
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>Test dark mode</title>
<style type="text/css">
body.dark {
background-color: #212529;
color: #6c757d;
}
@BramEsposito
BramEsposito / functions.php
Last active October 4, 2018 14:44
theme gravity forms with bootstrap
<?php
// ADD THIS TO THE functions.php file OF YOUR (CHILD) THEME
// apply to all forms
add_filter( 'gform_field_content', function ( $field_content, $field ) {
if ($field->type == "name") {
$field_content = preg_replace( '(<input)', '<input class="form-control" ', $field_content );
} else {
$field_content = preg_replace( '(<input .*class=\')', '$0form-control ', $field_content );
$field_content = preg_replace( '(<select .*class=\')', '$0form-control ', $field_content );
@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
@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 / 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 / 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 / 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