Skip to content

Instantly share code, notes, and snippets.

View timjgleeson's full-sized avatar

Tim Gleeson timjgleeson

  • Sydney, Australia
View GitHub Profile

Stylus Plugin Use

This document will briefly review a few of the more common ways of using stylus plugins for those who are not familiar. Throughout these examples, we will be using a non-existant stylus plugin called example. Please change example out for whatever plugin you are actually trying to use!

Standalone/Node

First example is for if you are building your own stylus pipeline in node. This is a pretty standard way to do things.

# db/migrate/XXXXXXXXXXXXX_add_authentication_token_to_users.rb
class AddAuthenticationTokenToUsers < ActiveRecord::Migration
def change
add_column :users, :authentication_token, :string
add_index :users, :authentication_token, :unique => true
end
end
{
"directory": "vendor/assets/components"
}
@timjgleeson
timjgleeson / hack.sh
Created March 31, 2012 10:09 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@timjgleeson
timjgleeson / golden.scss
Created January 24, 2012 05:57 — forked from alexeckermann/golden.scss
Golden CSS3-POINT-OH
$golden-ratio: 1.61803399; // Everyone's doing it!
@function golden-division($value, $times: 1) {
@for $i from 1 through $times {
$value: $value / $golden-ratio;
}
@return round($value);
}