Skip to content

Instantly share code, notes, and snippets.

@dvessel
dvessel / README.mdown
Last active May 15, 2020 13:18
Sass+Compass, Guard, LiveReload

This will enable Sass+Compass with LiveReload through Guard. (Guard screen cast)

You will also need a browser component to communicate with LiveReload. (browser extension, livereload.js)

If you prefer going through a GUI, that option is available. The following instructions is specific to Mac OS X and it works through the command line.

Note that this is not specific to Rails projects. This can work for any standalone front-end project.

Instructions

@LeaVerou
LeaVerou / vunits.js
Created November 8, 2011 11:05
Static polyfill for vw, vh, vm units
/**
* Polyfill for the vw, vh, vm units
* Requires StyleFix from -prefix-free http://leaverou.github.com/prefixfree/
* @author Lea Verou
*/
(function() {
if(!window.StyleFix) {
return;
@chriseppstein
chriseppstein / 0_selector_hacks.scss
Created September 14, 2011 04:27
This gist demonstrates some uses of the new sass feature: Passing content blocks to mixins.
@mixin ie6 { * html & { @content } }
#logo {
background-image: url("/images/logo.png");
@include ie6 { background-image: url("/images/logo.gif"); }
}
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@ChristianPeters
ChristianPeters / css_splitter.rake
Created August 8, 2011 10:22
Split CSS files so that there are no more than a given number of selectors in one style sheet. This is a tool to cope with Internet Explorer's limitation of max. 4095 selectors per stylesheet.
require 'rake'
require 'css_splitter'
desc 'split css files'
namespace :css do
task :split do
infile = ENV['infile'] || raise("missing infile")
outdir = ENV['outdir'] || File.dirname(infile)
max_selectors = ENV['max_selectors'] || 4095
// DEPRECATED
// see https://github.com/livereload/livereload-js/blob/master/dist/livereload.js for an up-to-date version
(function() {
var __protocol = {}, __connector = {}, __timer = {}, __options = {}, __reloader = {}, __livereload = {}, __startup = {};
// protocol
(function() {
var PROTOCOL_6, PROTOCOL_7, Parser, ProtocolError;
var __indexOf = Array.prototype.indexOf || function(item) {
/*
Adapt.js licensed under GPL and MIT.
Read more here: http://adapt.960.gs
*/
// Closure.
(function(w, d, config, undefined) {
// If no config, exit.
if (!config) {
@rfay
rfay / .gitignore
Created February 25, 2011 05:59
Create a huge reference repo
nbproject

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@ggilder
ggilder / TextMate_scriptmate_fix.rb
Created November 3, 2010 22:35
Fix TextMate's scriptmate.rb to work with Ruby 1.9
# located at /Applications/TextMate.app/Contents/SharedSupport/Support/lib/scriptmate.rb
# change lines 12 - 13:
$KCODE = 'u' if (RUBY_VERSION.to_f < 1.9)
require "jcode" unless "".respond_to? :each_char
# rest of the file is unchanged