Skip to content

Instantly share code, notes, and snippets.

View codearachnid's full-sized avatar
🎯
Focusing

Timothy Wood codearachnid

🎯
Focusing
View GitHub Profile
@nekman
nekman / jquery.attrMatcher.js
Last active January 4, 2016 13:49
jQuery attribute matcher.
/**
* http://plnkr.co/edit/Mou8b94hzmuIVjd7b63w?p=preview
*/
(function(global, factory) {
// CommonJS
if (typeof module === 'object') {
module.exports = factory(require('jquery'));
} else if (typeof global.define === 'function') {
// AMD
define(['jquery'], factory);
@codearachnid
codearachnid / tribe-admin-events-list.class.php
Created November 19, 2013 01:03
The Events Calendar: Fixed bug with improper column name when in admin main event list. Applies to TEC Pro 3.2. Notes: recently, while updating a client's website to the 3.2 plugin suite for Tribe's The Events Calendar I found that in the admin event list all the disappeared. After the normal, deactivating plugins, default theme etc I took the s…
<?php
/**
* update ~line 26 to include 2 argument params as such:
*/
add_filter( 'posts_orderby', array( __CLASS__, 'events_search_orderby' ), 10, 2 );
/**
* update static function `events_search_orderby` (replace with the following method starting at ~line 159)
*/
@spivurno
spivurno / gw-field-info-tab.php
Created October 25, 2013 20:36
Gravity Wiz // Gravity Forms Field Info Tab
<?php
/**
* Gravity Forms Field Info Tab
* http://gravitywiz.com
*
* Adds a summary of your fields as a tab on the form settings screen; includes field ID, label and field type.
*
*/
class GWFieldInfo {
@hyle
hyle / ko.utils.3.0.0.signatures.js
Created October 25, 2013 13:08
KnockoutJS 3.0.0 utils (ko.utils) signatures
// knockout 3.0.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@olimortimer
olimortimer / gist:6775681
Created October 1, 2013 08:56
JS: Select2 FastClick Fix
$('#select2').select2({
data: data,
// Add our 'needsclick' to each item, so FastClick doesn't get applied
formatResult: function(result, container, query, escapeMarkup) {
container.addClass('needsclick');
return result.text;
}
});
@kloon
kloon / deploy.sh
Last active December 4, 2020 14:05
Github to WordPress.org plugin repo deploy
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="camptix-payfast-gateway"
CURRENTDIR=`pwd`
MAINFILE="camptix-payfast.php" # this should be the name of your main php file in the wordpress plugin
# git config
@corsonr
corsonr / gist:6182904
Last active April 9, 2022 15:38
WooCommerce - Add custom fee to cart
<?php
/**
* WooCommerce Extra Feature
* --------------------------
*
* Add custom fee to cart automatically
*
*/
function woo_add_cart_fee() {
@corsonr
corsonr / gist:6154996
Created August 5, 2013 10:41
WooCommerce - Place "related products" within a tab
<?php
/*
* Place this code in functions.php in the theme folder
*/
/*
* Remove related products from product page
*/
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
@corsonr
corsonr / gist:6154614
Created August 5, 2013 09:30
WooCommerce - Empty cart URL
<a class="button" href="<?php echo $woocommerce->cart->get_cart_url(); ?>?empty-cart"><?php _e( 'Empty Cart', 'woocommerce' ); ?></a>
@hyle
hyle / ko.utils.2.3.0.signatures.js
Last active September 25, 2018 09:11
KnockoutJS 2.3.0 utils (ko.utils) signatures
// knockout 2.3.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }