Skip to content

Instantly share code, notes, and snippets.

@greypants
greypants / SassMeister-input-HTML.html
Created November 26, 2013 18:49 — forked from tommymarshall/SassMeister-input-HTML.html
Generated by SassMeister.com.
<button class="button -blue -large -rounded overrides -disable -right">I'm a button!</button>
@greypants
greypants / jquery.plugin.js
Created June 19, 2013 17:41 — forked from davist11/gist:2702312
JS: jQuery Plugin Pattern
/*
* 'Highly configurable' mutable plugin boilerplate
* Author: @markdalgleish
* Further changes, comments: @addyosmani
* Licensed under the MIT license
*/
// Note that with this pattern, as per Alex Sexton's, the plugin logic
// hasn't been nested in a jQuery plugin. Instead, we just use
// jQuery for its instantiation.
@greypants
greypants / _layout.php
Created March 4, 2013 21:53 — forked from jgarber623/_layout.php
PHP: Rails Layout
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo $page_title; ?></title>
</head>
<body>
<?php echo $content_for_layout; ?>
@greypants
greypants / gist:4253097
Created December 10, 2012 20:25 — forked from madrobby/gist:4161897
CSS: Retina screen media query
@media (min--moz-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(-webkit-min-device-pixel-ratio: 1.5),
(min-device-pixel-ratio: 1.5),
(min-resolution: 144dpi),
(min-resolution: 1.5dppx) {
/* Retina rules! */
}
@greypants
greypants / gist:3306778
Created August 9, 2012 18:21 — forked from davist11/gist:2702312
JS: jQuery Plugin Pattern
/*
* 'Highly configurable' mutable plugin boilerplate
* Author: @markdalgleish
* Further changes, comments: @addyosmani
* Licensed under the MIT license
*/
// Note that with this pattern, as per Alex Sexton's, the plugin logic
// hasn't been nested in a jQuery plugin. Instead, we just use
// jQuery for its instantiation.
@greypants
greypants / README.markdown
Last active October 17, 2023 05:49 — forked from reagent/nav_link.rb
RAILS 3: nav_link helper for adding 'selected' class to navigation elements
@greypants
greypants / rAF.js
Created August 2, 2012 14:59 — forked from paulirish/rAF.js
JS: requestAnimationFrame polyfill (Irish-Moller )
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
@greypants
greypants / gist:3185028
Created July 26, 2012 22:45 — forked from djadriano/gist:2975860
SCSS: keyframe mixins
// ======================================================================
// Animation.scss
// - Contains helpers for keyframes animation in css3
// - Only functionally with Sass 3.2.0 Alpha and Compass 0.13.alpha
// ======================================================================
@mixin animation-name($name) {
-webkit-animation-name: $name;
-moz-animation-name: $name;
-ms-animation-name: $name;
@greypants
greypants / uri.js
Created May 25, 2012 17:43 — forked from jlong/uri.js
JS: URI and Query String Parsing
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"