Skip to content

Instantly share code, notes, and snippets.

@steveosoule
steveosoule / ie-detection.js
Created October 11, 2012 18:00 — forked from padolsey/gist:527683
JavaScript: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@steveosoule
steveosoule / transpose_table.js
Created November 16, 2012 23:26 — forked from pepebe/transpose_table.js
JS: Transpose HTML table using jQuery
$(function() {
var t = $('#thetable tbody').eq(0);
var r = t.find('tr');
var cols= r.length;
var rows= r.eq(0).find('td').length;
var cell, next, tem, i = 0;
var tb= $('<tbody></tbody>');
while(i<rows){
cell= 0;
@steveosoule
steveosoule / MvCALL-with-JSON.xml
Last active August 29, 2015 14:26 — forked from mghdotdev/MvCALL-with-JSON.xml
MVT: MvCALL with JSON
<mvt:comment>Define JSON holding variable</mvt:comment>
<mvt:assign name="l.settings:json" value="''" />
<mvt:comment>Define URL Variable</mvt:comment>
<mvt:assign name="g.url" value="'http://example.com/'" />
<mvt:comment>Call `g.url` and Concatenate `s.callvalue` into `l.settings:json`</mvt:comment>
<mvt:call action="g.url" method="'GET'">
<mvt:assign name="l.settings:json" value="l.settings:json $ s.callvalue" />
</mvt:call>
@steveosoule
steveosoule / HTML-on-Product-Display
Last active August 29, 2015 14:26 — forked from tessguefen/HTML-on-Product-Display
Zoom Plugin with Variants, on load of page.
Add the following on the right side of your product display layout area (aka where the price is)
<div id="zoom-hold" class="zoom-hold" style="display: none;"><div class="inner"></div></div>
@steveosoule
steveosoule / bling.js
Created March 3, 2016 00:44 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
// Examples of pure functions. No side effects. No mutations.
function square(x) {
return x * x;
}
function squareAll(items) {
return items.map(square);
}
// Examples of impure functions.
@steveosoule
steveosoule / README.md
Last active October 5, 2016 18:50 — forked from bheyde/gist:26d12958c5c013dd99165a6bc182a79a
Dynamic Resize Images Based on URL
@steveosoule
steveosoule / readytheme_link_load.xml
Created May 26, 2016 17:58 — forked from tessguefen/readytheme_link_load.xml
MvDo to load in URL (aka loading readytheme navigation set) // URI
@steveosoule
steveosoule / jquery.ba-tinypubsub.js
Last active May 26, 2016 22:13 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* https://github.com/cowboy/jquery-tiny-pubsub
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
@steveosoule
steveosoule / fluid-typography.css
Created June 7, 2016 16:30 — forked from iksi/fluid-typography.css
Fluid typography between a min & max font-size and molten leading
/**
* Fluid typography between a min & max font-size and molten leading
* calc(minSize + (maxSize - minSize) * ((100vw - minPort) / (maxPort - minPort)));
*/
:root {
font-size: 100%;
}
body {
font-size: 1em;