Skip to content

Instantly share code, notes, and snippets.

View pgr86's full-sized avatar

Patrick Gollmer pgr86

View GitHub Profile
@pgr86
pgr86 / dabblet.css
Created March 17, 2014 07:58
Untitled
// =============================================================================
// Modernizr mixin
//
// Table of contents:
// 1. Modernizr mixin
// 1.1 Generate placholder name and selectors
// 1.2 Define placholder and print @content
// 1.3 Define feature selector and extend the placeholder
// 2. Aliases
// 2.1 Yep alias
@pgr86
pgr86 / dabblet.css
Created February 25, 2013 12:42
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@pgr86
pgr86 / jquery.ba-tinypubsub.js
Created November 24, 2012 08:28 — 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/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@pgr86
pgr86 / hashSwitcher.html
Created April 19, 2012 12:15
Switching visible divs using hash change event (used to have all data on one page, but switch what's visible using javascript. MOBILE BROWSERS ANYONE?)
<!DOCTYPE html>
<html>
<head>
<title>Hash Switcher</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<style>
.page {
display: none;
}
// AJAX pagination support with will_paginate and jQuery; history fix via jQuery-BBQ
baseurl = location.protocol + '//' + location.host + location.pathname;
$(function() {
$('.pagination a').live('click', function(e) {
params = $.deparam.querystring(this.href);
new_url = $.param.fragment(baseurl, params, 2);
$(this).parent('.pagination').append("<img src='/images/spinner.gif' class='spinner' />"); // show loading spinner
location.hash = $.param.fragment( new_url ); // set the new hash, which will trigger the hashchange event
// Make jQuery UI tabs pick the selected tab from the URL hash,
// and set the selected tab id as the hash.
//
// By Henrik Nyh <http://henrik.nyh.se> 2009-09-10 under the MIT License.
// Based on code by Mark Yoon: http://articles.rootsmith.ca/mod_python/how-to-make-jquery-ui-tabs-linkable-or-bookmarkable#comment-10188
$('#foo').tabs();
$('.tabs').each(function() {