Skip to content

Instantly share code, notes, and snippets.

View pfulton's full-sized avatar

Patrick Fulton pfulton

View GitHub Profile
@Chaser324
Chaser324 / GitHub-Forking.md
Last active April 4, 2025 07:45
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@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);
}
@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.
@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
@cimmanon
cimmanon / flexbox.scss
Last active January 14, 2025 18:21 — 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
@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);
@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(
@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

@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() {