Skip to content

Instantly share code, notes, and snippets.


Brewster brewster1134

View GitHub Profile
brewster1134 / modifier mixin
Last active Feb 13, 2016
modify parents from within nested selectors
View modifier mixin
.vegetables .carrot {
color: orange;
.vegetables.out-of-season .carrot {
color: brown;
.fruits .apple {
color: red;
View input.sass
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
$bem-block: $bem-block !global
=el($element, $before: "", $after: "", $mod: "")
brewster1134 / example.sass
Last active Aug 29, 2015
Compass Spriting w/ Retina & Media Query Support
View example.sass
// call the all-sprites mixin to generate the base styles
// with MARKUP
// the following markup with generate retina assets for retina display, or regular images if a regular display
// <div class="global-image1"/>
// with SASS
// if you need to share a sprite with another element, just extend it
View 2520.rb
# What's the smallest number divisible be all of 1, 2, 3, 4, 5, 6, 7, 8, and 9?
require 'colorize'
def check_num num
(num % 9 == 0) && (num % 8 == 0) && (num % 7 == 0) && (num % 6 == 0)
multiple = 10
current_num = multiple



Load Natural Text Editing Preset


Key Bindings

Select by line
change  shift + command + left   to: Move Start of Selection Back/Left    by Line
change  shift + command + right  to: Move End of Selection Forward/Right  by Line
brewster1134 / keymap
Last active Dec 14, 2015
Sublime Text setup
View keymap
{ "keys": ["super+f"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },
{ "keys": ["super+alt+down"], "command": "duplicate_line" },
{ "keys": ["super+shift+d"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" }
View sprockets-urlrewriter

After spending much time looking into the various solutions for serving vendored CSS containing relative urls (with much help from Bibliographic Wilderness, I decided on using the sprockets-urlrewriter preprocessor.

After some adjustments to the regex used to identify and rewrite the CSS urls, there was one other issue.

Although the sprockets-urlrewriter claims to rewrite relative urls to absolute ones, what it really does is rewrites urls relative to itself, to urls relative to the root asset directory.

This means that if the CSS all being compiled into application.css, everything works great. However if in development you are debugging your assets (a default in Rails), each CSS is linked individually. This means that the newly re-written urls are relative to application.css, but referenced in a different css file.

This is still ok if the location of the

You can’t perform that action at this time.