Skip to content

Instantly share code, notes, and snippets.

View juliangarnier's full-sized avatar

Julian Garnier juliangarnier

View GitHub Profile
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@anthonyshort
anthonyshort / _media-queries.scss
Created March 13, 2012 10:37
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@Victa
Victa / _media-object.scss
Created January 18, 2012 09:45
OOCSS media object - SCSS mixin
@mixin media-object($margin:10px, $position: left, $formating-context: 'overflow', $media: '.media', $block: '.block') {
@include pie-clearfix; // or extend a .clearfix class
#{unquote($block)} {
@if $formating-context == 'overflow' {
overflow:hidden;
} @else {
display:table-cell;
width:10000px;
*width:auto;
*zoom:1;
@nathansmith
nathansmith / percentage_grid.sass
Created December 30, 2011 19:24
Percentage Based "Grid"
// How I would approach a fluid grid:
//
// [1] Let the name reflect the % width,
// eliminating "1 of 12" guesswork.
//
// [2] Also, put 10px of padding to either
// side, to stack and make a 20px gutter.
//
// [3] Make the box-sizing = border-box, so that
// 50% + 20px total side padding = 50%, etc.
@balupton
balupton / README.md
Last active February 10, 2025 05:38
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo