Skip to content

Instantly share code, notes, and snippets.

View dcneiner's full-sized avatar

Doug Neiner dcneiner

View GitHub Profile
@dcneiner
dcneiner / gist:2960711
Created June 20, 2012 16:11 — forked from micahwave/gist:2948501
WP-Paginate markup
<ol class="wp-paginate">
<li><span class="title"></span></li>
<li><span class="prev">Previous</span></li>
<li><a href="#page" title="1" class="page">1</a></li>
<li><span class="page current">2</span></li>
<li><a href="#page/3" title="3" class="page">3</a></li>
<li><a href="#page/4" title="4" class="page">4</a></li>
<li><a href="#page/5" title="5" class="page">5</a></li>
<li><span class="gap">...</span></li>
<li><a href="#page/8" title="8" class="page">8</a></li>
@dcneiner
dcneiner / dabblet.css
Created June 8, 2012 16:07
CSS Dice: An Experiment by Jonathan Sampson - @jonathansampson
/* CSS Dice: An Experiment by Jonathan Sampson - @jonathansampson */
.die.one:after {
box-shadow: 0 .2em 0 #FFF
}
.die.two:after {
background: transparent;
box-shadow: -2.3em -2.3em 0 #345,
2.3em 2.3em 0 #345,
-2.3em -2.3em 0 #FFF,
2.3em 2.4em 0 #FFF
@dcneiner
dcneiner / dabblet.css
Created June 8, 2012 15:03 — forked from jonathansampson/dabblet.css
CSS Dice: An Experiment by Jonathan Sampson - @jonathansampson
/* CSS Dice: An Experiment by Jonathan Sampson - @jonathansampson */
.die.one:after {
box-shadow: 0 .2em 0 #FFF
}
.die.two:after {
background: transparent;
box-shadow: -2.3em -2.3em 0 #345,
2.3em 2.3em 0 #345,
-2.3em -2.3em 0 #FFF,
2.3em 2.4em 0 #FFF
@dcneiner
dcneiner / jquery.dontAnnoyDevsInWebkit.js
Created December 20, 2011 17:20
Removes the use of layerX and layerY in jQuery 1.4, 1.5, 1.6 (If you can't upgrade to jQuery 1.7 for some reason) - Even referencing these properties throws a warning in Chrome
// Add this code snippet after including jQuery
// The if statement protects you in case you forget to remove this
// once you upgrade to 1.7, or if you try to use it with jQuery 1.3
if (jQuery.event.props[17] === "layerX" ) {
jQuery.event.props.splice(17,2);
}
@dcneiner
dcneiner / gist:1137601
Created August 10, 2011 17:48
List of Inherited CSS
Consolidated lists of CSS properties that are inherited by default.
Taken from http://www.w3.org/TR/CSS21/propidx.html
--------------------------------------------------------------------
One item not in the list was "text-decoration" which affects child elements. A few new properties (text-shadow) also affect child elements
List
azimuth
border-collapse
@dcneiner
dcneiner / jquery-bookmarklet.html
Created May 1, 2011 04:28
jQuery Mobile View Source Bookmarklet Website
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>jQuery Mobile Original Source Bookmarklet for Chrome</title>
<style type="text/css" media="screen">
body, html, h1 { margin: 0; padding: 0; }
html { padding: 20px; background: #ddd; }
body { max-width: 600px; margin: 0 auto; padding: 20px; box-sizing: border-box; background: #fff; font-family: Helvetica, arial; box-shadow: rgba(0,0,0,0.2) 0 0 5px }
@dcneiner
dcneiner / codeigniterfix.php
Created April 3, 2011 19:13
Older versions of CI can't handle random query string parameters. This is how you clean it out.
<?php
// Place in index.php, at the top
function clean_hnp() {
$reset_query = false;
$keys = array(
'action', 'hnp_post'
);
foreach ($keys as $key) {
/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {
// Original code from David Walsh
jQuery(document).ready(function() {
/* fetch elements */
jQuery('form.follow-form').each(function() {
/* stop form event */
jQuery(this).bind('submit',function(e) {
/* stop event */
e.preventDefault();
/* "on request" */
jQuery(this).find('i').addClass('active');
a:after {
...
content: attr(title); /* Default to title */
...
};
html.js a:after {
...