Skip to content

Instantly share code, notes, and snippets.

View jeffcdavis's full-sized avatar
👨‍💻

Jeff Davis jeffcdavis

👨‍💻
View GitHub Profile
@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;
/**
* 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();
@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);
}
@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
//
// 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 ) {
@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
@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
@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"]');
@Yame-
Yame- / add-woocommerce-product.php
Last active December 6, 2022 17:14
Adding a WooCommerce product programmatically.
<?php
$args = array(
'post_author' => 1,
'post_content' => '',
'post_status' => "draft", // (Draft | Pending | Publish)
'post_title' => '',
'post_parent' => '',
'post_type' => "product"
);
@claudiosanches
claudiosanches / functions.php
Last active September 24, 2024 17:55
WooCommerce - Change ajax variation threshold
function custom_wc_ajax_variation_threshold( $qty, $product ) {
return 10;
}
add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 );