Skip to content

Instantly share code, notes, and snippets.

@steveosoule
steveosoule / javascript-dynamically-fit-text-in-div.html
Created November 14, 2012 18:22
JavaScript Dynmaically Fit Text in Div
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script>
;(function($) {
$.fn.textfill = function(options) {
var fontSize = options.maxFontPixels;
@steveosoule
steveosoule / javascript-touch-events.html
Created November 14, 2012 18:24
JavaScript Touch Events
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
var gnStartTime = 0;
var gbMove = false;
var gbStillTouching = false;
@steveosoule
steveosoule / javascript-secure-non-secure-check.js
Created November 14, 2012 18:25
JavaScript Secure/Non-Secure Check
if (location.protocol === 'https:') {
var url="https://www.gidabavari.com/mm5/form/prod-form-process.php"
} else {
var url="http://www.gidabavari.com/mm5/form/prod-form-process.php"
};
@steveosoule
steveosoule / javascript-cookie-create-read-erase.js
Last active October 12, 2015 19:08
JavaScript Cookie Creation, Reading, and Erasing
@steveosoule
steveosoule / miva-drop-down-template-code.html
Created November 15, 2012 01:04
Miva Drop Down Menu Template Code
<mvt:item name="toolkit" param="parentcat|pccount" />
<ul class="dropdown" style="margin:0;">
<mvt:foreach iterator="parent_category" array="parent_categories">
<li style="margin:0;"><a href="/category/&mvte:parent_category:code;.html" title="&mvte:parent_category:name;">&mvte:parent_category:name;</a>
<mvt:item name="toolkit" param="subcat|ccount|l.all_settings:parent_category:code" />
<mvt:if expr="ccount GT 0">
<ul class="sub-menu" style="margin:0;">
<mvt:foreach iterator="sub_category" array="sub_categories">
<li style="margin:0;"><a href="/category/&mvte:sub_category:code;.html" title="&mvte:sub_category:name;">&mvte:sub_category:name;</a>
<mvt:item name="toolkit" param="subcat2|ccount2|l.all_settings:sub_category:code" />
@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 / miva-time-sensative-content-mktime.html
Created November 27, 2012 22:24
Miva Time Sensitive Content - mktime
<mvt:item name="toolkit" param="set_time_zone|our_time|-4" />
<mvt:item name="toolkit" param="time_t_year|year|our_time" />
<mvt:item name="toolkit" param="time_t_month|month|our_time" />
<mvt:item name="toolkit" param="time_t_dayofmonth|dayofmonth|our_time" />
<mvt:item name="toolkit" param="time_t_hour|hours|our_time" />
<mvt:item name="toolkit" param="time_t_minute|minutes|our_time" />
<mvt:item name="toolkit" param="time_t_second|seconds|our_time" />
<mvt:item name="toolkit" param="mktime_t|currenttime|year|month|dayofmonth|hours|minutes|seconds|our_time" />
<mvt:item name="toolkit" param="sassign|promoEndTime|1354348801"/> <mvt:comment> http://www.epochconverter.com/ </mvt:comment>
@steveosoule
steveosoule / browser-selector-hacks.css
Created November 28, 2012 18:27
CSS - Browser Selector Hacks
/***** Selector Hacks ******/
/* IE6 and below */
* html #uno { color: red }
/* IE7 */
*:first-child+html #dos { color: red }
/* IE7, FF, Saf, Opera */
html>body #tres { color: red }
@steveosoule
steveosoule / meta-tags.html
Created November 28, 2012 18:28
HTML - Meta Tags
<meta name="Title" content="Snowmobile parts, snowmobile exhaust, snowmobile gear, snowmobile helmets and snowmobile accessories plus a full line of snowmobile clothing."/>
<meta name="Author" content="First Place Parts"/>
<meta name="Description" content="Snowmobile parts and snowmobile accessories including snowmobile gear, snowmobile exhaust, snowmobile helmets, snowmobile tracks and many more snowmobile parts."/>
<meta name="Keywords" content="snowmobile parts, snowmobile part, snowmobile exhaust, snowmobile gear, snowmobile helmet, snowmobile helmets, snowmobile tracks, snowmobile accessories, snowmobile apparel, snowmobile clothing, gortex boot, snowmobile cover, snowmobile mufflers, snowmobiles covers, boondocker, gortex boots, snowmobile jacket, snowmobile pipes"/>
<meta name="Language" content="English"/>
<meta name="Abstract" content="Snowmobile parts and snowmobile accessories."/>
<meta name="Copyright" content="© First Place Parts"/>
<meta name="Designer" content="First Place Parts"/>
<meta name="
@steveosoule
steveosoule / delay-function.js
Created November 28, 2012 18:30
JavaScript - Delay Function
var delay = (function(){
var timer = 0;
return function(callback, ms){
clearTimeout (timer);
timer = setTimeout(callback, ms);
};
})();
$('input').keyup(function() {
delay(function(){