Skip to content

Instantly share code, notes, and snippets.

View pavenuto's full-sized avatar

Paul Venuto pavenuto

View GitHub Profile
// Inspired by the King of the Kurbs!
// $.trace('Woooo!');
$.extend({
trace: function(msg){
if (window.console) {
console.log(msg);
};
}
});
jQuery(
function($) {
$.easing.myEaseOut = function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
}
}
);
// <h3>Join Our Mailing List</h3>
//
// <div id="theForm">
// <form action="http://inmunited.createsend.com/t/r/s/tdfly/" method="post" id="subForm">
// <input type="text" class="text" name="cm-tdfly-tdfly" placeholder="Email Address" id="tdfly-tdfly" />
// <input type="submit" class="submit" value="GO" />
// </form>
// </div>
// <div id="confirmation">
// Thanks for subscribing!
function geoLocate()
{
navigator.geolocation.getCurrentPosition(foundLocation, noLocation);
}
function foundLocation(position)
{
var lat = position.coords.latitude;
var long = position.coords.longitude;
window.location="/locations/geo/" + lat + "," + long;
$.fn.TouchClass = function(className, options) {
var settings = { stick: false };
if (options) $.extend(settings, options);
if (typeof(className) == 'undefined') {
var className = 'active';
}
var downEvent = (window.Touch) ? 'touchstart' : 'mousedown',
upEvent = (window.Touch) ? 'touchend' : 'mouseup';
<!DOCTYPE html>
<html>
<head>
<title>Experimental data stuff</title>
<style>
* {margin: 0; padding: 0; color: rgba(0,0,0,1);}
body { font-size: 62.5%; line-height: 1.7;}
article {margin: 12px auto; border: 1px solid #ccc; width: 470px; padding: 20px 40px;}
.initialized {background: rgba(255,255,0, 0.2);}
if ($('#no-results').length) {
var term = $('#search-results').find('li:first a.only-this-tag').text();
if ($("#search-results").find('li').length == 1) {
$.track('ProductSearch', 'ZeroResults', term);
}
}
if ($("#zip-code-search").length) {
$("#zip-code-search").bind("submit", function(e) {
var zipcode = $('#zip_code').val();
/* Grid */
.row, div[class*='span-'] { float: left; }
.row {
clear: both;
width: 100%;
}
[class*='span-'] {
@pavenuto
pavenuto / grid-factory.html
Created February 28, 2011 16:52
Playing around with Paul Irish's plugin factory and data- attributes
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="css/style.css">
<style type="text/css" media="screen">
.cell {display: inline-block; background: #FCF7CA; padding: 10px; position: absolute; font: bold 16px Helvetica, Arial, sans-serif;}
.w-1 {width: 80px;}
.w-2 {width: 160px;}
jQuery.extend({
random: function(X) {
return Math.floor(X * (Math.random() % 1));
},
randomBetween: function(MinV, MaxV) {
return MinV + jQuery.random(MaxV - MinV + 1);
}
});