Skip to content

Instantly share code, notes, and snippets.

@dovy
dovy / 0_reuse_code.js
Created January 31, 2014 22:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/*
* The page core options for the Shoestrap theme
*/
if ( !function_exists( 'shoestrap_module_coulourlovers_options' ) ) :
function shoestrap_module_coulourlovers_options( $sections ) {
// Page Options

Redux Shortcodes

A useful class which wraps a few core WordPress functions that, we think, should be inherit in WordPress. So instead, we made a class. Here's a brief overview of the features.

[bloginfo data=""]

Get any data available to the bloginfo() function. A full list of options is found: http://codex.wordpress.org/Function_Reference/bloginfo

[themeinfo data=""]

Get any of the values of the wp_get_theme function. A full list of options is found: http://codex.wordpress.org/Function_Reference/wp_get_theme

<?php
$boxSections = array();
$boxSections[] = array(
'title' => __('Home Settings', 'redux-framework-demo'),
'header' => __('Welcome to the Simple Options Framework Demo', 'redux-framework-demo'),
'desc' => __('Redux Framework was created with the developer in mind. It allows for any theme developer to have an advanced theme panel with most of the features a developer would need. For more information check out the Github repo at: <a href="https://github.com/ReduxFramework/Redux-Framework">https://github.com/ReduxFramework/Redux-Framework</a>', 'redux-framework-demo'),
'icon_class' => 'icon-large',
'icon' => 'el-icon-home',
// 'submenu' => false, // Setting submenu to false on a given section will hide it from the WordPress sidebar menu!
'fields' => array(
@dovy
dovy / list.js
Last active January 2, 2016 18:29
'use strict';
angular.module('rootSnapApp')
.constant('ListCtrlResolver', {
ancestry: function(familysearch) {
return familysearch.getCurrentUserPersonId().then(function(id) {
return familysearch.getAncestry(id, {personDetails: true}).then(function(response) {
return response.getPersons();
});
});
Azeri - Azərbaycan Dili (az_AZ)
آذربایجان دیلی - آذری (azb_AZB)
Azerbaijani (Turkey) - Azərbaycan Türkcəsi (az_TR)
Afrikaans - Afrikaans (af)
Albanian - Shqip (sq_AL)
Arabic – عربي (ar)
Aragonese - Aragonés (an)
Assamese - অসমীয়া (as)
Bangla - Bengali (bn_BD)
Basque - Euskara (eu)
<?
if ( !class_exists( "ReduxFramework" ) ) {
return;
}
if ( !class_exists( "SMOF2Redux_{{opt_name}}_{{uuid}}" ) ) {
class SMOF2Redux_{{opt_name}}_{{uuid}} {
public function __construct( ) {
// Your base config file for Redux
add_action( 'redux/loaded', array($this, 'addPanel') );
<?php
if ( !class_exists( "ReduxFramework" ) ) {
return;
}
if ( !class_exists( "Redux_Framework_redux_converter_cf5486bd5852b65564baf7c" ) ) {
class Redux_Framework_redux_converter_cf5486bd5852b65564baf7c {
public function __construct( ) {
// Your base config file for Redux
<?
array(
'id'=>'typographyTest',
'type' => 'typography',
'title' => __('Typography', 'redux-framework-demo'),
'font-style'=>false, // Includes font-style and weight. Can use font-style or font-weight to declare
'font-weight'=>false, // Includes font-style and weight. Can use font-style or font-weight to declare
'subsets'=>false, // Only appears if google is true and subsets not set to false
'font-size'=>false,
'font-family'=>false,
@dovy
dovy / SMOF2Redux.php
Last active December 28, 2015 23:19
Add the following file somewhere within your theme. It will create a demo panel with your SMOF data as well as a SMOF2Redux Export menu item, to grab a functioning Redux configuration file.
<?php
if( !class_exists( 'SMOFtoRedux' ) ) {
class SMOFtoRedux {
public function __construct( ) {
add_action('init', array($this, 'addPanel'), 100);
add_action( 'admin_menu', array($this, 'addExportMenu') );