Skip to content

Instantly share code, notes, and snippets.

/**
* Setup images sprite having high resolution variant for retina displays.
*
* It will create class names for all available icons.
*
* This uses custom function to prefix selectors from array. To get it working you will need to include following snippet in your config.rb
*
* module Sass::Script::Functions
* def prefix_each(array, prefix)
* return Sass::Script::String.new array.to_a.map{|item| prefix.value + item.value}.join(", ")

INSTALLATION

  1. Save script to e.g. /usr/local/bin/media-query-combiner
  2. chmod +x /usr/local/bin/media-query-combiner

USAGE

Reads from stdin and writes to stdout.

// Social Colors
// ====================================================================
$facebook_color: #365397;
$twitter_color: #00a9f1;
$linkedin_color: #006db3;
$apple_color: #737373;
$google_color: #4285f4;
$google_plus_color: #e0452c;
$youtube_color: #ff3333;
# best path for assets in Wordpress project
http_path = "/wp-content/themes/TheFold/"
css_dir = "."
sass_dir = "sass"
images_dir = "img"
javascripts_dir = "js"
fonts_dir = "fonts"
output_style = :expanded
environment = :development
var gistPrefix = 'http://gist.github.com/',
// Cache document.write so that it can be restored once all Gists have been
// embedded.
cachedWrite = document.write,
body = jQuery('body'),
// Map each p.gist to an object that contains the paragraph to be replaced
// and the Gist's identifier.
gists = jQuery('p.gist').map(function(n, p) {
p = jQuery(p);
@darren131
darren131 / gist:2926558
Created June 13, 2012 21:18 — forked from padolsey/gist:527683
JavaScript: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}