Skip to content

Instantly share code, notes, and snippets.

// Social Colors
// ====================================================================
$facebook_color: #365397;
$twitter_color: #00a9f1;
$linkedin_color: #006db3;
$apple_color: #737373;
$google_color: #4285f4;
$google_plus_color: #e0452c;
$youtube_color: #ff3333;
@darren131
darren131 / config.rb
Created March 24, 2014 02:14
Dev vs prod compass compiling
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "css"
images_dir = "images"
javascripts_dir = "js"

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.

/**
* 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(", ")
@darren131
darren131 / config.rb
Created May 9, 2014 03:43
Default compass config file
require 'autoprefixer-rails'
require 'breakpoint'
require 'scut'
require 'sass-media_query_combiner'
http_path = "/"
sass_dir = "sass"
css_dir = "public/css"
http_stylesheets_path = "/css"
@darren131
darren131 / sprite.less
Created April 18, 2012 01:37
Sprite LESS Snippet. Someone else has probably done this already, but I thought I'd share it nevertheless.
@spritePath: '../images/sprite.png';
.sprite(@url: @spritePath, @xpos: 0, @ypos: 0) {
background-image: url(@url);
background-repeat: none;
background-position: @xpos @ypos;
}
@darren131
darren131 / arrows.less
Created May 30, 2012 00:25
CSS only arrows in LESS
// HOW TO USE
//
// @direction: up;
// .class {
// .arrow(@direction, #c00, 20px);
// }
//
.arrow(up, @color, @size) {
width: 0;
@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) {}
@darren131
darren131 / gist:2926833
Created June 13, 2012 22:20
CSS: Image Replacement
.ir {
font: 0/0 a;
text-shadow: none;
color: transparent;
}
@darren131
darren131 / gist:2962766
Created June 20, 2012 22:57
JavaScript: Closure
(function( $ ){
// set up global variables
var ObjectName;
// Navigation object
ObjectName = {
method: function() {
},