This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin mobile_bg($file){ | |
background-image: image-url('mobile/standard/#{$file}'); | |
@media screen and (-webkit-min-device-pixel-ratio: 2) { | |
background-image: image-url('mobile/retina/#{$file}'); | |
background-size: image-width('mobile/standard/#{$file}') image-height('mobile/standard/#{$file}'); | |
} | |
} | |
// Usage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
# Compiling | |
gem 'compass' | |
gem 'compass-growl' | |
# Guard | |
gem 'guard' | |
gem 'guard-compass' | |
gem 'guard-livereload' | |
gem 'guard-process' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Easy GA debugging - to test, add ?ga_debug to the URL</title> | |
<script> | |
var _gaq = _gaq || []; | |
var _ga_debug = window.location.href.indexOf('ga_debug') !== -1; | |
_gaq.push(['_setAccount', 'UA-00000000-1']); | |
_gaq.push(['_trackPageview']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.shureicons-font { | |
font-family: 'shureicons'; | |
-webkit-font-smoothing: subpixel-antialiased; | |
} | |
@mixin logo($height) { | |
@include box-sizing(border-box); | |
display: block; | |
height: $height; | |
padding-top: $height; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rmagick' | |
source = ARGV[0] | |
Dir.glob('images/' + source + '/*.*').each do |retina_path| | |
mobile_path = retina_path.sub(/retina/, 'normal') | |
retina_file = File.new(retina_path) | |
mobile_file = File.new(mobile_path) if File.exist?(mobile_path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Macro: "data-track-gtm - get from element" | |
// Returns: Boolean - does this element, or one of its parents, have a data-track-gtm attribute? | |
function() { | |
var isSet = function(val) { | |
return val !== null && val !== ''; | |
}; | |
var el = {{element}}; | |
var val = el.getAttribute('data-track-gtm'); | |
while (el && el !== document.body && !isSet(val)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# just add these lines to development.rb | |
config.assets.debug = false | |
config.serve_static_assets = true | |
config.assets.js_compressor = :uglifier | |
config.assets.digest = true | |
# then on the command line | |
rake assets:precompile && rails s |
- Performance evaluation. Without minification and gzip, you can't always make accurate decisions regarding filesize changes, or do reasonable network speed testing locally.
- Cache-busting. By compiling your files and saving them with unique names, you're removing the need to clear the browser cache when testing on mobile devices and in older IE.
- Catching bugs.
- This is rarer now than it used to be, but uglify has historically created occasional issues in IE8. Better to catch them locally than on integration.
- Running in production mode exposes problems related to explicit filenames, since a production deploy can change filenames and break related code.