Skip to content

Instantly share code, notes, and snippets.

View jeffcdavis's full-sized avatar
👨‍💻

Jeff Davis jeffcdavis

👨‍💻
View GitHub Profile
@ksprwhite
ksprwhite / bs-validation.js
Last active February 26, 2018 23:28
bootstrap validation | nav-tabs
var FormValidation = (function($) {
var context = null;
function FormValidation(form) {
this.form = $(form);
this.tabs = $(form).find('.nav-tabs a[role="tab"]');
this.panels = $(form).find('.tab-content [role="tabpanel"]');
@jesseeproductions
jesseeproductions / ecp-cf-3-9
Last active February 16, 2024 07:00
The Events Calendar Custom Fields and [email protected]
The Events Calendar Custom Fields @3.9
Event Custom Post Type ( tribe_events )
_EventAllDay
_EventStartDate
_EventEndDate
_EventDuration
_EventVenueID
_EventShowMapLink
_EventShowMap
@BFTrick
BFTrick / woocommerce-enable-free-shipping-per-product.php
Last active October 29, 2019 19:11
Enable Free Shipping on a per product basis in WooCommerce.
<?php
/**
* Plugin Name: WooCommerce Enable Free Shipping on a Per Product Basis
* Plugin URI: https://gist.github.com/BFTrick/d4a21524a8f7b25ec296
* Description: Enable free shipping for certain products
* Author: Patrick Rauland & eugenf
* Author URI: http://speakinginbytes.com/
* Version: 1.0.2
*
* This program is free software: you can redistribute it and/or modify
// BASED on this article - http://www.bennadel.com/blog/2597-preloading-images-in-angularjs-with-promises.htm
// Preloading Images In AngularJS With Promises.
// I provide a utility class for preloading image objects.
TRMFullScreenApp.factory(
"preloader",
function( $q, $rootScope, $timeout ) {
// I manage the preloading of image objects. Accepts an array of image URLs.
function Preloader( imageLocations ) {
@rewonc
rewonc / app.js
Last active October 26, 2021 00:16
AngularJS/PhoneGap/Ionic: filter to convert links for opening in separate mobile window
//*
//* See the JS Fiddle: http://jsfiddle.net/sxcjmoj5/3/
//*
//*
// make sure ngSanitize module is installed:
// https://docs.angularjs.org/api/ngSanitize
//
// To convert links from plaintext, you must use the linky filter which is included with ngSanitize
// https://docs.angularjs.org/api/ngSanitize/filter/linky
//
@rileypaulsen
rileypaulsen / functions.php
Created August 19, 2014 16:08
Add Advanced Custom Fields Fields to the WP REST API
function wp_api_encode_acf($data,$post,$context){
$data['meta'] = array_merge($data['meta'],get_fields($post['ID']));
return $data;
}
if( function_exists('get_fields') ){
add_filter('json_prepare_post', 'wp_api_encode_acf', 10, 3);
}
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@davidchang
davidchang / feed-reader-v2.html
Created May 17, 2014 12:01
Feed Reader version 2, using Angular/Underscore/Bootstrap CSS.
<!doctype html>
<html ng-app="feedReaderApp">
<head>
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.2.2/css/bootstrap.min.css" rel="stylesheet">
<style>
.title {
cursor: pointer;
font-weight: bold;
font-size: 24.5px;
line-height: 40px;
@tommcfarlin
tommcfarlin / complete-mobile-media-query-boilerplate.css
Last active July 22, 2018 06:57
A media query boilerplate for responsive design that covers iPhones, iPhone 5s, tablets, and iPads for viewing sites and applications in both portrait and landscape mode.
/**
* Note that the following media queries are intended to be used for the specified device or screen size
* in both portrait and landscape mode.
*
* Desktop queries are not provided since the default styles for most sites and applications typically focus
* on that for the default sites.
*
* Contributes, comments, and all that fun stuff always welcome :).
*/
@kloon
kloon / functions.php
Created September 9, 2013 08:50
WooCommerce Previous & Next product links
<?php
// Add previous and next links to products under the product details
add_action( 'woocommerce_single_product_summary', 'wc_next_prev_products_links', 60 );
function wc_next_prev_products_links() {
previous_post_link( '%link', '< Previous' );
echo ' | ';
next_post_link( '%link', 'Next >' );
}
?>