Skip to content

Instantly share code, notes, and snippets.

View pfulton's full-sized avatar

Patrick Fulton pfulton

View GitHub Profile
@pamelafox
pamelafox / tumlbr_template.html
Created April 12, 2012 19:07
Twitter Bootstrap Tumblr Theme
<!doctype html>
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name='description' content='{MetaDescription}'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@robtarr
robtarr / resize.js
Created July 9, 2012 14:51
Google Analytics Resize Tracking
(function() {
var resizeTimer;
// Assuming we have jQuery present
$( window ).on( "resize", function() {
// Use resizeTimer to throttle the resize handler
clearTimeout( resizeTimer );
resizeTimer = setTimeout(function() {
@adamlogic
adamlogic / compass_and_css_sprites.md
Created September 1, 2012 15:26
Compass and CSS Sprites, Explained

Compass and CSS Sprites, Explained

Last week I attempted to use the CSS sprites feature of Compass for the second or third time. It's been a struggle each time, but the power and potential is there, so I keep coming back. This time was a bit different, though, because I finally decided to stop relying on the docs and dive into the code.

Before I go into the nitty-gritty, let's take a step back and talk about why I

@jo-snips
jo-snips / custom-one-month.php
Created September 9, 2012 23:04
The Events Calendar: Custom Query for 1 Month Future Events
<?php
global $post;
$current_date = date('j M Y');
$end_date = date('j M Y', strtotime('1 month'));
echo 'Start Date:'. $current_date;
echo 'End Date:'. $end_date;
$all_events = tribe_get_events(
array(
@ethanmuller
ethanmuller / Readme
Created November 8, 2012 16:03
HD Sprite Mixin
This mixin requires three arguments: the standard definition sprite map, the hd sprite map, and the icon you want to use.
Optionally, you can give it X and Y offsets to position it, a width to resize it, or you can center it on the X axis, Y axis, or both.
Use it something like this:
// Create sprite maps
// (Just do this once per sprite sheet)
$general-sd: sprite-map("icons/general/*.png", $spacing: 30px);
$general-hd: sprite-map("hd/icons/general/*.png", $spacing: 60px);
@cimmanon
cimmanon / flexbox.scss
Last active September 17, 2020 15:05 — forked from anonymous/Flexbox mixins
This collection of Sass mixins to cover all 3 flexbox specifications that have been implemented. More information can be found here: https://gist.github.com/cimmanon/727c9d558b374d27c5b6
@import "compass/css3/shared";
// NOTE:
// All mixins for the 2009 spec have been written assuming they'll be fed property values that
// correspond to the standard spec. Some mixins can be fed values from the 2009 spec, but don't
// rely on it. The `legacy-order` mixin will increment the value fed to it because the 2009
// `box-ordinal-group` property begins indexing at 1, while the modern `order` property begins
// indexing at 0.
// if `true`, the 2009 properties will be emitted as part of the normal mixin call
@nfreear
nfreear / wai-aria-landmark-roles-html5.haml
Created February 5, 2013 13:17
HTML5 boilerplate with WAI-ARIA landmark roles (IET-LTT, ou, qa, Haml)
<!doctype html>
%html{:lang => "en"}
%meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"}/
%meta{:charset => "utf-8"}/
/[if lt IE 9]
<script src="//html5shim.googlecode.com/svn/trunk/html5-els.js"></script>
<script> document.createElement("main") </script>
%title MY TITLE
%header{:role => "banner"}
%h1 BANNER
@JohnAlbin
JohnAlbin / _init.scss
Last active May 17, 2024 04:32
Handing IE8 and lower with Breakpoint + compass/support
// Initialize the Sass variables and partials used in this project.
// Set the legacy IE support variables. We override the default values set by
// the compass/support partial, but let styles-ie8.scss override these values.
$legacy-support-for-ie6 : false !default;
$legacy-support-for-ie7 : false !default; // Note the use of !default.
$legacy-support-for-ie8 : false !default;
// Partials to be shared with all .scss files.
@marcmartino
marcmartino / mergeSortedArrays.js
Created December 23, 2013 20:25
Write a function that takes two sorted lists of numbers and merges them into a single sorted list.
var assert = require('assert');
function sortMerged(lOne, lTwo) {
return lOne.reduce(function (sortedList, num, index) {
var position = findPositionBinary(sortedList, num);
sortedList.splice(position, 0, num);
return sortedList;
}, lTwo);
}