Skip to content

Instantly share code, notes, and snippets.

View thetrickster's full-sized avatar

Chris Matthias thetrickster

View GitHub Profile
@thetrickster
thetrickster / Remove Open Sans from Wordpress 3.8 .md
Last active March 8, 2022 12:26
Remove Open Sans from Wordpress >= 3.8 front-end

The reason you might not be able to remove the Open Sans font that Wordpress >= 3.8 adds to the frontend is that quite a few WP styles and scripts list 'open-sans' as a dependancy when being registered and enqueued. When you remove the 'open-sans' style the other plugins dependant on it will not load. So you just need to deregister WP's open sans style and register your own, with a false value for the src like below.

Credit to seventhsteel from http://wordpress.org/support/topic/turning-off-open-sans-for-the-38-dashboard

@thetrickster
thetrickster / Gruntfile.js
Created January 31, 2014 21:17
Foundation 5 Gruntfile.js to compile sass with libsass and copy bower components to /js/ in your project. Run `npm install && bower install` and then `grunt` to watch
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
includePaths: ['bower_components/foundation/scss']
},
dist: {
options: {
@thetrickster
thetrickster / yahoo-webplayer-beta.js
Created July 3, 2013 02:56
Yahoo! Webplayer beta script for hosting on your own domain since Yahoo! removed the webplayer docs and scripts from their servers on June 1st, 2013
/* Yahoo! WebPlayer Loader, Build 0.9.76. Copyright (c) 2013, Yahoo! Inc. All rights reserved.
* Your use of this Yahoo! WebPlayer is subject to the Yahoo! Terms of Service
* located at http://info.yahoo.com/legal/us/yahoo/webplayer/details.html
*/
(function(){var d="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js";if(typeof YAHOO=="undefined"){YAHOO={};}if(typeof YAHOO.MediaPlayer=="undefined"){YAHOO.MediaPlayer=function(){this.controller=null;};}YAHOO.MediaPlayer.isAPIReady=false;YAHOO.MediaPlayer.onAPIReady={subscribers:[],fire:function(){for(var f=0;f<this.subscribers.length;f++){if(YAHOO.MediaPlayer.isAPIReady===true){try{this.subscribers[f]();}catch(g){}}}},subscribe:function(e){this.subscribers.push(e);}};YAHOO.WebPlayer=YAHOO.MediaPlayer;var c=false;function b(f,h){var e=document.createElement("script");e.setAttribute("type","text/javascript");e.setAttribute("src",f);var g=document.getElementsByTagName("head")[0];e.onload=e.onreadystatechange=function(){if(!e.readyState||/loaded|complete/.tes
@thetrickster
thetrickster / gist:5493542
Last active November 10, 2017 04:52
Enable/Disable form fields based on Facebook Like Button events. Press Like and form fields are disabled
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
// init the FB JS SDK
@thetrickster
thetrickster / bc-disable-country-redirect.js
Created July 8, 2013 01:21
Disable visitors of a certain country or countries access to your site by redirecting them to another page in Business Catalyst
var userCountryCode = "{module_visitorcountrycode}";
var disallowedCountryCodes = ["US", "UK"];
var redirectBlockedUsersURL = "/country-blocked.html";
(function($) {
$.each(disallowedCountryCodes, function(i,val) {
if ( val == userCountryCode ) {
window.location = redirectBlockedUsersURL;
}
});

Keybase proof

I hereby claim:

  • I am thetrickster on github.
  • I am chrismatthias (https://keybase.io/chrismatthias) on keybase.
  • I have a public key ASBPQ6BDJD22nM34MBpZVmlF8-lQ0b-OO4m6z7dWLKRX2Ao

To claim this, I am signing this object:

@thetrickster
thetrickster / contact-form-7-slug-validation.php
Last active January 10, 2016 03:09
Slug Validation for Contact Form 7
<?php
function cf7_slug_validation($result,$tag) {
$type = $tag['type'];
$name = $tag['name'];
if($type == 'text*' && $_POST[$name] == ''){
$result['valid'] = false;
$result['reason'][$name] = wpcf7_get_message( 'invalid_required' );
/**
* Add the field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>';
/**
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@thetrickster
thetrickster / README.md
Last active December 19, 2015 20:49
Find and replace Gyrotonic trademark text in a website using jQuery

Gyrotonic® Trademark jQuery Plugin

Beta Version - Still a work in progress. Use at own risk.

Find and replace text node instances of Gyrotonic/Gyrokinesis in a web page and replace with the correct brand styles required by Gyrotonic Sales Group.

  • Download the script below and save it to your website
  • Reference the script in the or of your website after jQuery is already loaded

``