Skip to content

Instantly share code, notes, and snippets.

test status

Jesse Aldridge JesseAldridge

test status
View GitHub Profile
EdenK / elementor-video-youtube-enablejsapi.php
Last active Sep 4, 2019
Filter to add enablejsapi to Elementor youtube video
View elementor-video-youtube-enablejsapi.php
* Filter to add enablejsapi to Elementor youtube video
function add_youtube_jsapi($iframe_html, $video_url, $frame_attributes) {
if(strpos($video_url, 'youtube') !== false) {
$src = esc_attr($frame_attributes['src']);
$new_src = esc_attr(add_query_arg(array('enablejsapi' => '1'), $frame_attributes['src']));
$iframe_html = str_replace($src, $new_src, $iframe_html);
devinsays / customer-new-account.php
Created Oct 3, 2017
Sends new WooCommerce customers an account email that with their email address as a login rather than a username.
View customer-new-account.php
* Customer new account email
* This template has been overriden to change account creation text.
* @see
* @author WooThemes
* @package WooCommerce/Templates/Emails
* @version 1.6.4
View gist:216120
¦-) as opposed to |
⍥ om nom nom
pch /
Last active Feb 18, 2019
How to install Unison on Mac OS El Capitan & Vagrant

How to install Unison on Mac OS El Capitan & Vagrant - for Docker Sync

You can install Unison on the Mac via homebrew (brew install unison), but it's very likely that it won't work properly, resulting in errors like:

Unison failed: Uncaught exception Failure("input_value: bad bigarray kind")
Fatal error: Lost connection with the server
lovingawareness / Makefile
Last active Nov 28, 2018
Periodic Screenshots (every 10 seconds) on Mac OS X
View Makefile
@echo "Please use \`make <target>' where <target> is one of"
@echo " screencap To start recording screencaps and clean up yesterday's captures."
@echo " cleanyesterday Just delete yesterday's captures."
@echo " captoday Just start recording screencaps for today."
fnielsen / gist:1226214
Created Sep 19, 2011
Email classification example with Python, NLTK, ...
View gist:1226214
documents = [ dict(
email=open("conference/%d.txt" % n).read().strip(),
category='conference') for n in range(1,372) ]
documents.extend([ dict(
email=open("job/%d.txt" % n).read().strip(),
category='job') for n in range(1,275)])
documents.extend([ dict(
email=open("spam/%d.txt" % n).read().strip(),
category='spam') for n in range(1,799) ])
richardhsu /
Created Dec 13, 2012
XML to SQL converter for Stack Overflow XML data dump files. For newer versions of MySQL you can use the LOAD XML and it can work out but for older versions this script can help.
#!/usr/bin/env python
""" Stack Overflow XML 2 SQL
The following is a custom made XML 2 SQL converter for Stack Overflow data.
Latest Stack Overflow Data: August 2012
Call Examples:
Terrance / Shlex.js
Last active Sep 4, 2016
A function for parsing shell-like quoted arguments into an array, similar to Python's shlex.split. Also allows quotes mid-way through a string, and parses them out for you. Returns false on failure (from unbalanced quotes).
View Shlex.js
function shlex(str) {
var args = str.split(" ");
var out = [];
var lookForClose = -1;
var quoteOpen = false;
for (var x in args) {
if (args.hasOwnProperty(x)) {
var arg = args[x];
var escSeq = false;
for (var y in arg) {
jpennell /
Created Sep 18, 2012
Fabric fabfile for Django/Heroku App
from fabric.api import env, local, require
def deploy():
"""fab [environment] deploy"""
You can’t perform that action at this time.