This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import E from './E' | |
class FocusManager { | |
/** | |
* Call this method to boot up. | |
*/ | |
static init() { | |
if (document.location.hash) { | |
FocusManager.focus(document.getElementById(window.location.hash.replace('#', '')), true) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_ship_to_different_address_checked', 'get_persitent_ship_to_different' ); | |
function get_persitent_ship_to_different ( $value ) | |
{ | |
$data = WC()->session->get('form_data'); | |
if ( ! $data || empty($data['ship_to_different_address']) ) | |
return $value; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_checkout_get_value', 'get_persistent_checkout', 10, 2 ); | |
function get_persistent_checkout ( $value, $index ) | |
{ | |
$data = WC()->session->get('form_data'); | |
if ( ! $data || empty($data[$index]) ) | |
return $value; | |
return is_bool($data[$index]) ? (int) $data[$index] : $data[$index]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_after_checkout_validation', 'set_persitent_checkout' ); | |
function set_persitent_checkout ( $a ) | |
{ | |
$arr = array(); | |
foreach ( $a as $key => $value ) | |
if ( ! empty($value) ) | |
$arr[$key] = $value; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// create a Set | |
$set = set( 'first item' ); | |
// Add a new value | |
$set[] = 'second item'; | |
// Add a new value | |
foreach ( $set as $val ) | |
print($val); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// assumes jquery | |
$('video').on('pause play ended', function ( e ) { | |
switch( e.type ) { | |
case 'play': | |
var percent = Math.round( e.target.currentTime / e.target.duration * 100 ); | |
ga('send', 'event', 'video', 'play', window.location.href, percent) | |
break; | |
case 'pause': | |
var percent = Math.round( e.target.currentTime / e.target.duration * 100 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_after_checkout_validation', 'set_persitent_checkout' ); | |
add_filter( 'woocommerce_checkout_get_value', 'get_persistent_checkout', 10, 2 ); | |
add_action( 'woocommerce_ship_to_different_address_checked', 'get_persitent_ship_to_different' ); | |
function set_persitent_checkout ( $a ) | |
{ | |
$arr = array(); | |
foreach ( $a as $key => $value ) | |
if ( ! empty($value) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function __construct () | |
{ | |
parent::__construct(); | |
// accessed via google developer console | |
$client_email = '****@developer.gserviceaccount.com'; | |
$private_key = file_get_contents(__DIR__ .'/secure.p12'); | |
$scopes = array(\Google_Service_Analytics::ANALYTICS_READONLY); | |
$user_to_impersonate = '****'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// basil.js | |
!function(){var e=function(n){return e.utils.extend({},e.plugins,(new e.Storage).init(n))};e.version="0.4.1",e.utils={extend:function(){for(var e="object"==typeof arguments[0]?arguments[0]:{},n=1;n<arguments.length;n++)if(arguments[n]&&"object"==typeof arguments[n])for(var t in arguments[n])e[t]=arguments[n][t];return e},each:function(e,n,t){if(this.isArray(e)){for(var i=0;i<e.length;i++)if(n.call(t,e[i],i)===!1)return}else if(e)for(var r in e)if(n.call(t,e[r],r)===!1)return},tryEach:function(e,n,t,i){this.each(e,function(e,r){try{return n.call(i,e,r)}catch(o){if(this.isFunction(t))try{t.call(i,e,r,o)}catch(o){}}},this)},registerPlugin:function(n){e.plugins=this.extend(n,e.plugins)}};for(var n=["Arguments","Boolean","Function","String","Array","Number","Date","RegExp"],t=0;t<n.length;t++)e.utils["is"+n[t]]=function(e){return function(n){return Object.prototype.toString.call(n)==="[object "+e+"]"}}(n[t]);e.plugins={},e.options=e.utils.extend({namespace:"b45i1",storages:["local","cookie","session"," |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AppPath = '/teimr/', | |
App = blocks.Application({ | |
history: 'pushState' | |
}); | |
App.View('Navigation', { | |
options: { | |
url: AppPath + 'views/navigation.html', | |
}, |
NewerOlder