Skip to content

Instantly share code, notes, and snippets.

talaviram /
Last active May 14, 2022
Simple Utility Script for allowing debug of hardened macOS apps.
#! /bin/bash
# Simple Utility Script for allowing debug of hardened macOS apps.
# This is useful mostly for plug-in developer that would like keep developing without turning SIP off.
# Credit for idea goes to (McMartin):
# Update 2022-03-10: Based on Fabian's feedback, add capability to inject DYLD for sanitizers.
# Please note:
# - Modern Logic (on M1s) uses `AUHostingService` which resides within the system thus not patchable and REQUIRES to turn-off SIP.
# - Some hosts uses separate plug-in scanning or sandboxing.
# if that's the case, it's required to patch those (if needed) and attach debugger to them instead.
vegaskev / functions.php
Created Jul 20, 2018
Change Gravity Forms Spinner to CSS Spinner
View functions.php
// Changes Gravity Forms Ajax Spinner (next, back, submit) to a transparent image
// this allows you to target the css and create a pure css spinner like the one used below in the style.css file of this gist.
add_filter( 'gform_ajax_spinner_url', 'spinner_url', 10, 2 );
function spinner_url( $image_src, $form ) {
return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; // relative to you theme images folder
jaredatch /
Created Jan 30, 2018
Install MailHog with MAMP Pro

Install MailHog with MAMP Pro, using HomeBrew.


First let's make sure HB is updated. Open up terminal for the following steps.

$ brew update
View final-cut-pro-trial-reset.swift
import Foundation
let path = URL(fileURLWithPath: NSString(string: "~/Library/Application Support/.ffuserdata").expandingTildeInPath)
let data = try! NSData(contentsOf: path) as Data
let dictionary = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as! NSDictionary
let mutableDictionary = dictionary.mutableCopy() as! NSMutableDictionary
for (key, value) in mutableDictionary {
helgatheviking / kia_add_script_to_footer.php
Created Feb 24, 2017
Add plus and minus buttons to WooCommerce quantity inputs
View kia_add_script_to_footer.php
View WP Customizer - Image Control
$wp_customize->add_setting( 'themeslug_media_setting_id', array(
'sanitize_callback' => 'absint',
'validate_callback' => 'themeslug_validate_image,
) );
new WP_Customize_Media_Control( $wp_customize, 'themeslug_media_setting_id', array(
'label' => __( 'Custom Core Media Setting' ),
'section' => 'custom_section', // Add a default or your own section
'mime_type' => 'image',
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016
Safari border-radius + overflow: hidden + CSS transform fix
View gist:b602ab436ac9f05660d9c15190f4fd7b
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
zlove / gist:3b9b6a611715ec3a8a60
Last active Feb 25, 2020
Preview WooCommerce Emails
View gist:3b9b6a611715ec3a8a60
* Quick hack to preview WooCommerce e-mails.
* Based on drrobotnik's answer from Stack Overflow:
* Add this to <yourtheme>/functions.php and then visit a url like:
* http://<site_url>/wp-admin/admin-ajax.php?action=previewemail
* @return null
benhuson / cust-vimeo-oembed
Last active Apr 18, 2020
Customise WordPress Vimeo oEmbed
View cust-vimeo-oembed
* Customise WordPress Vimeo oEmbed
function my_oembed_fetch_url( $provider, $url, $args ) {
if ( strpos( $provider, '' ) !== false) {
mannieschumpert / gist:8334811
Last active Jul 13, 2020
Filter the submit button in Gravity Forms to change the <input type="submit> element to a <button> element. There's an example in the Gravity Forms documentation, but it lacks the proper code to show your custom button text, AND removes important attributes like the onclick that prevents multiple clicks. I was trying to solve that.
View gist:8334811
// filter the Gravity Forms button type
add_filter("gform_submit_button", "form_submit_button", 10, 2);
function form_submit_button($button, $form){
// The following line is from the Gravity Forms documentation - it doesn't include your custom button text
// return "<button class='button' id='gform_submit_button_{$form["id"]}'>'Submit'</button>";
// This includes your custom button text:
return "<button class='button' id='gform_submit_button_{$form["id"]}'>{$form['button']['text']}</button>";
// Oops this strips important stuff