Skip to content

Instantly share code, notes, and snippets.

@abrkn
abrkn / cryptowatch-historical-rates.gs
Last active Mar 20, 2018
Cryptowatch Historical Rates for Google Apps Script
View cryptowatch-historical-rates.gs
// cryptowatch-historical-rates.gs
// Cryptowatch Historical Rates for Google Apps Script
// Version: 1.0
//
// Usage:
// =fetchCryptowatchRateFor("bitfinex", "BCHUSD", "2018-03-01")
// =fetchCryptowatchRateFor("bitfinex", "BCHUSD", "2018-03-01", "open")
// Defaults to closing price
function fetchCryptowatchRateFor(venue, symbol, date, which) {
var index = ['open', 'high', 'low', 'close'].indexOf(which || "close");
@RadGH
RadGH / recalculate-acf-locations.php
Last active Sep 10, 2021
Get latitude and longitude for addresses saved in Advanced Custom Fields, using Google's GeoLocation API
View recalculate-acf-locations.php
<?php
global $acf_recalc_settings;
// IMPORTANT: Customize these settings for your website.
$acf_recalc_settings = array(
// How many updates to do each page load. As of November 2018, Google's GeoLocation API limit is 100 per second.
'posts_per_run' => 16,
@KTPH
KTPH / acf-repeater-remove-front-end-dependency.php
Last active May 28, 2017
Remove Front-End Dependency for ACF Repeater Field Example (displays images with src, alt, width/height and also other sub fields)
View acf-repeater-remove-front-end-dependency.php
// Masonry Grid
$slides = get_post_meta( get_the_ID(), 'image_gallery_grid', true );
// Check if acf/custom field data exists
if( $slides ) { ?>
<ul class="grid effect-5" id="grid">
<?php
for( $i = 0; $i < $slides; $i++ ) { // Custom Count/Loop through rows
@omurphy27
omurphy27 / WooCommerce - Change Wrapping Markup through Main Content Action Hook.php
Last active Jun 16, 2021
WooCommerce - Change Wrapping Markup through Main Content Action Hook.php
View WooCommerce - Change Wrapping Markup through Main Content Action Hook.php
<?php
// add core markup to woocommerce pages
add_action('woocommerce_before_main_content', 'woocommerce_output_content_wrapper');
// overwrite existing output content wrapper function
function woocommerce_output_content_wrapper() {
echo '<div class="main-bg no-top-banner">
<div class="container">
<div id="content" class="row" >
<div id="main" class="col-md-9 pull-right clearfix" >';
@DevinWalker
DevinWalker / gravity-forms_bootstrap
Last active Mar 28, 2017
Gravity Forms Twitter Bootstrap CSS Styles Turn OFF Gravity Forms CSS Turn On HTML5 See: http://roots.io/style-gravity-forms-with-bootstrap/
View gravity-forms_bootstrap
/* ------------------------------------
Gravity Forms
---------------------------------------*/
.gform_wrapper ul { padding-left: 0; list-style: none }
.gform_wrapper li { margin-bottom: 15px }
.gform_wrapper form { margin-bottom: 0 }
@NateJacobs
NateJacobs / gist:1286583
Created Oct 14, 2011
WordPress Function: Every time a user updates his/her profile an email is sent to the site administrator.
View gist:1286583
<?php
/**
* Updated User Profile Notification
*
* Every time a user updates his/her profile an email is sent
* to the site administrator.
*
* @author Nate Jacobs
* @link https://gist.github.com/1286583
*/
@markjaquith
markjaquith / disable-plugins-when-doing-local-dev.php
Created Jun 24, 2011
Disables specified WordPress plugins when doing local development
View disable-plugins-when-doing-local-dev.php
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/