View ad-blocked-mvga-overrides.js
/**
If Google Analytics does not load (add-blocking, network issues, etc.),
Then we need to disable the MVGA tracking functions and let the forms/links submit normally.
*/
$(window).on('load', function add_ga_failsafes(){
if( typeof ga !== 'undefined' && typeof ga.create !== 'undefined' ){
return;
}
MVGA_Tracker.prototype.List_AddToBasketSubmit = function(e){};
MVGA_Tracker.prototype.RemoveFromBasketForms = function(e){};
View wordpress-custom-post-types.php
<?
// FROM: http://www.webdesignerdepot.com/2014/10/how-to-take-your-wordpress-sites-to-the-next-level-with-custom-post-types/
// Append the following code to WordPress's "functions.php" file
add_action( 'init', 'register_movie' );
function register_movie() {
$labels = array(
View wget-crawl-script.sh
#!/bin/sh
# wget --mirror --adjust-extension --page-requisites --execute robots=off --wait=30 --rand om-wait --convert-links --user-agent=Mozilla http://www.example.com
### V1
# wget \
# --recursive \
# --no-clobber \
# --page-requisites \
# --html-extension \
View README.md

jquery.getScriptCached.js

jQuery's $.getScript function is a quick and easy way to include external JavaScript files into a website. However, its default implimentation will not cache the script file for the client.

The following information describes how you can itilize cached versions of $.getScript

Usage

  1. Include jquery, if it's not already.
View miva-mvt-do-scheduled-task-update.xml
<mvt:assign name="g.xml" value="'
<Provision>
<Store code=\"' $ g.Store_Code $ '\">
<ScheduledTask_Update task=\"TASK NAME\">
<Description>TASK NAME</Description>
<Enabled>true</Enabled>
<NextRun>
<Year>' $ s.dyn_tm_year $ '</Year>
<Month>' $ s.dyn_tm_mon $ '</Month>
<Day>' $ s.dyn_tm_mday $ '</Day>
View miva-smart-breadcrumbs-http_referer-adjustment-global-pre-render.xml
<mvt:comment>
|---------------------------------------------------------------------
| SMART-BREADCRUMBS S.HTTP_REFERER ADJUSTMENT
|---------------------------------------------------------------------
| Alters Smart-Breadcrumbs & Category-Tree behavior that always
| loads breadcrumb hierarchies based on s.http_referer; even when
| the refering category is not in the product's hierarchy.
|---------------------------------------------------------------------
| 1.) Check Referring Category
| 2.) Check Current Request's Product
View miva-logging-into-yyyy-mm-dd-folders.xml
<mvt:comment>
| ---------------------------------------------
| LOGGING
| ---------------------------------------------
</mvt:comment>
<mvt:comment>
| Create Log Folders based on date: /YYYY/MM/DD/
</mvt:comment>
<mvt:assign name="l.settings:log:folder_path:base" value="'/logs/'" />
View customizing-searchspring-facet-options.md

Search Spring Facet Customizations

About

SearchSpring's default AJAX display functionality does not give us direct access to the HTML that is used to render the facets, so we have to use their JavaScript API's function hooks to select the desired facet and modify it with JavaScript/jQuery.

Basic Changes

The Default SearchSpring facet HTML is typically a nested set of unordered lists like this:

View ansi2html.sh
#!/bin/sh
# SOURCE: http://www.pixelbeat.org/scripts/ansi2html.sh
# Convert ANSI (terminal) colours and attributes to HTML
# Licence: LGPLv2
# Author:
# http://www.pixelbeat.org/docs/terminal_colours/
# Examples:
View template-engine.js
// http://mir.aculo.us/2011/03/09/little-helpers-a-tweet-sized-javascript-templating-engine/
function t(s,d){
for(var p in d)
s=s.replace(new RegExp('{'+p+'}','g'), d[p]);
return s;
}
t("Hello {who}! It's {time} ms since epoch.", { who: "JavaScript", time: Date.now });
// "Hello JavaScript! It's 1299680443046 ms since epoch."