Skip to content

Instantly share code, notes, and snippets.

@dovy
dovy / familysearch-auth.php
Created April 20, 2015 17:41
FamilySearch gedcomx-php SDK getting started example.
<?php
require 'vendor/autoload.php';
use Gedcomx\Rs\Client\StateFactory;
use Gedcomx\Rs\Client\Rel;
use Guzzle\Http\Message\Request;
// Your app key goes here
define("CLIENT_ID", "your-app-key-goes-here");
// The REDIRECT_URI should point to this PHP file. The redirect URI must be registered with your app key.
@dovy
dovy / redux_nettuts_v2.php
Created April 20, 2015 15:52
This is the complete example config we created in this tutorial.
<?php
Redux::setArgs(
'tuts_plus_tutorial', // This is your opt_name,
array( // This is your arguments array
'display_name' => 'Tuts+ Tutorial',
'display_version' => 'Part 2',
'menu_title' => 'Tuts+ Menu Item',
'admin_bar' => 'true',
'page_slug' => 'tuts_plus_page_slug', // Must be one word, no special characters, no spaces
<?php
Redux::setSection(
'tuts_plus_tutorial', // This is your opt_name,
array( // This is your arguments array
'id' => 'subsectionsection_example_1', // Unique identifier for your panel. Must be set and must not contain spaces or special characters
'title' => 'Subsection Parent',
'icon' => 'el el-magic', // http://elusiveicons.com/icons/
//'subsection' => true, // Enable this as subsection of a previous section
)
);
Redux::init('opt_name')
Force load of a Redux object even if it's been run.
Redux::getSection( $opt_name = '', $id = '' )
Get a specific section for the given opt_name by the section_id
Redux::setSections( $opt_name = '', $sections = array() )
Set a group of sections at once.
Redux::setSection( $opt_name = '', $section = array() )
@dovy
dovy / new-presets-merge-example.php
Created February 21, 2015 04:11
To add to the redux docs.
array('id' => 'dovytest', 'type'=>'typography', 'title' => 'Dovy Test'
),
array(
'id' => 'opt-presets',
'type' => 'image_select',
'presets' => true,
'title' => __('Preset', 'redux-framework-demo'),
'subtitle' => __('This allows you to set a json string or array to override multiple preferences in your theme.', 'redux-framework-demo'),
'default' => 0,
'desc' => __('This allows you to set a json string or array to override multiple preferences in your theme.', 'redux-framework-demo'),
/**
* WooCommerce Quanity buttons add-back
*/
jQuery( function( $ ) {
var $testProp = $( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).find('qty');
if ($testProp && $testProp.prop('type') != 'date') {
// Quantity buttons
$( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).addClass( 'buttons_added' ).append( '<input type="button" value="+" class="plus" />' ).prepend( '<input type="button" value="-" class="minus" />' );
// Target quantity inputs on product pages

There are various WooCommerce shipping integration available. We're only going to go through the ones I could find.

TrueShip

<?php
$new = array(
'pwp_google_analytics' => get_option( 'pwp_google_analytics' ),
'pwp_google_universal_analytics' => get_option( 'pwp_google_universal_analytics' ),
'pwp_google_universal_analytics_displayfeatures' => get_option( 'pwp_google_universal_analytics_displayfeatures' ),
);
$update = false;
foreach($new as $key => $value) {
if ( isset($flexslider) && $images = get_children( array(
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'order' => 'ASC',
'orderby' => 'ID',
'post_mime_type' => 'image',
) )
) {
global $content_width;
$size = 'rdx_blog_' . $content_width . '_archive';
@dovy
dovy / Sendy.md
Last active January 12, 2022 19:50 — forked from danielepolencic/Sendy.md

Sendy

Sendy is a self hosted email newsletter application that lets you send trackable emails via Amazon Simple Email Service (SES).

Heroku

You can deploy Sendy on Heroku using the following instructions (I assume you've already installed the heroku toolbelt).

  1. On Heroku, create a new app.
  2. Clone that app to your desktop