Skip to content

Instantly share code, notes, and snippets.

@tessguefen
tessguefen / .htaccess
Created October 2, 2017 20:29 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@tessguefen
tessguefen / critcss.snippet.js
Created January 7, 2017 21:18 — forked from pibby/critcss.snippet.js
Critical CSS Finder w/media query support for those of us who write mobile-first CSS; will output to console; configurable viewport height on line 12.
/* Critical CSS Finder w/media query support and output to console
by Katie Harron - https://github.com/pibby - https://pibby.com
forked from james-Ballyhoo (https://gist.github.com/james-Ballyhoo/04761ed2a5778c505527) who forked from PaulKinlan (https://gist.github.com/PaulKinlan/6284142)
I don't know why this isn't keeping my 2 space indents :(
*/
(function() {
function findCriticalCSS(w, d) {
// Pseudo classes formatting
var formatPseudo = /([^\s,\:\(])\:\:?(?!not)[a-zA-Z\-]{1,}(?:\(.*?\))?/g;
@tessguefen
tessguefen / accept-json.mvt
Last active December 7, 2016 21:23 — forked from steveosoule/accept-json-post-data.xml
Miva s.content_data to Read Raw POST Data
<h2>s.content_data</h2>
<pre><mvt:eval expr="s.content_data"/></pre>
<h2>miva_json_decode(s.content_data, l.settings:json)</h2>
<mvt:assign name="l.result" value="miva_json_decode(s.content_data, l.settings:json)" />
<p><b>&amp;mvt:json:foobar; =</b> &mvt:json:foobar;</p>
<p><b>&amp;mvt:json:message; =</b> &mvt:json:message;</p>
@tessguefen
tessguefen / .htaccess
Created September 18, 2016 18:48 — forked from ludo237/.htaccess
The ultimate .htaccess file. Please feel free to fork it, edit it and let me know what do you think about it.
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
# This is the free sample of .htaccess from 6GO s.r.l.
# @author Claudio Ludovico Panetta (@Ludo237)

Miva - Profiling and Diagnostic Process

logfile=diagtool.log
loglevel=144
logcookie=mivadiagtool
  • Visit page(s) that you're trying to troubleshoot
  • Download /private/mivadata/diagtool.log file
@tessguefen
tessguefen / check-all-checkboxes.js
Created November 23, 2015 18:14 — forked from steveosoule/check-all-checkboxes.js
Check all Checkboxes
(function(){function checkFrames(w) {try {var inputs = w.document.getElementsByTagName('input');for (var i=0; i < inputs.length; i++) {if (inputs[i].type && inputs[i].type == 'checkbox'){inputs[i].checked = !inputs[i].checked;}}} catch (e){}if(w.frames && w.frames.length>0){for(var i=0;i<w .frames.length;i++){var fr=w.frames[i];checkFrames(fr);}}}checkFrames(window);})()
@tessguefen
tessguefen / CreditCardChecker.js
Created September 24, 2015 23:21 — forked from mghdotdev/CreditCardChecker.js
Miva: Single Input Credit Card Checker
// ---- Credit Card Checker (No OPAY) ---- //
var CreditCardChecker = {
init: function (cc_input) {
this.cc = $(cc_input);
this.cc.keyup(function() {
$('.credit-card.highlighted-card').removeClass('highlighted-card');
this.check( $(this.cc).val() );
}.bind(this));
@tessguefen
tessguefen / SearchSpring.Catalog.afterResultsChange.js
Last active August 29, 2015 14:25 — forked from steveosoule/miva-searchspring-after-results-change.js
Search Spring - After Result Change Psuedo Example
afterResultsChange: function() {
$(document).trigger('SearchSpring_AfterResultsChange');
}
<div id="{{ code|upper }}" class="{{ product_id }} item" {% if resultIndex%2 == 1 %}style="border-right: 0"{% endif %}>
<p class='name'><a href="{{ url }}" {{ intellisuggest }}>{{ name|escape }}</a></p>
<div class="prodimg">
<a href="{{ url }}" {{ intellisuggest }}><img src="{{ thumbnailImageUrl|strip_http }}" onerror="this.onerror=null;this.src='//d1qhbfo7yqnkif.cloudfront.net/ajax_search/img/missing-image-75x75.gif';" /></a>
</div>
<div class="prodinfo">
<p style="margin-bottom: 0">Item#: {{ code }}</p>
{% if nopricing and nopricing == "YES" %}
<mvt:if expr="ISNULL g.ab_version AND ISNULL g.ab_flush">
<mvt:item name="customfields" param="Read_Basket('ab_version', g.ab_version)" />
</mvt:if>
<mvt:if expr="ISNULL g.ab_version">
<mvt:assign name="g.randomNumber" value="random(100)" />
<mvt:if expr="g.randomNumber GE 50">
<mvt:assign name="g.ab_version" value="'A'"/>
<mvt:else>
<mvt:assign name="g.ab_version" value="'B'"/>
</mvt:if>