Skip to content

Instantly share code, notes, and snippets.

@cbfrance
cbfrance / sass_visualizer.rb
Created March 7, 2012 00:59
Visualize a Sass project
#!/usr/bin/env ruby
require 'graphviz'
class Visualizer
def initialize
@g = GraphViz.new( "G", :type => "graph", :rankdir => "LR", :bgcolor => "#808080", :aspect => 1 )
end
def prune(file)
file.gsub(/\S+\/(\S+)\.scss/, '\\1').gsub(/@import ['"](\S+\/)?(\S+)['"];/, '\\2')
@cbfrance
cbfrance / HOT_alt
Created August 28, 2011 23:26
HOT symbology, alternate approach
Road features
road basics
bridge
footbridge
path
steps
1-lane
2-lane
4-lane
residential
@cbfrance
cbfrance / HOT_indonesia_v1.txt
Created August 28, 2011 23:07
Proposed Taxonomy From Toha
1 Rumah (House)
1.1 Sangat Miskin (Very Poor)
1.2 Miskin (Poor)
1.3 Sedang (Medium)
1.4 Kaya (Rich)
1.5 Kondisi Bangunan (Building Conditions)
1.5.1 Atap (Roof)
1.5.1.1 Ilalang (Weeds)
1.5.1.2 Seng / Asbes (Zinc / Asbestos)
@cbfrance
cbfrance / tabs.scss
Created August 9, 2011 00:48
compass scss tab mixin
@import "colors";
@import "buttons.scss";
@import "compass/css3";
@mixin tabs {
float: left;
width: 100%;
background: transparent;
margin: 0!important;
height: 43px;
@cbfrance
cbfrance / resources.scss
Created August 4, 2011 23:05
I love how you can do stuff like this in Compass/Sass with mixins — for styling similar but different elements
@mixin resource-layout(
$width: $primary_width,
$language_dir: left,
$type: discussion,
$background_color: none,
$icon_width: 40px,
$padding: $default_padding) {
background-color: $background_color;
border-top: 2px solid lighten($tarawera, 10%);
@cbfrance
cbfrance / layout.scss
Created June 29, 2011 23:05
Bidirectional layout
/*directional mixins*/
@import "base";
@import "welcome";
@import "announcement";
@import "favorites";
@import "tags";
@import "sidebar";
@import "nav";
@import "tabs";
@cbfrance
cbfrance / compass example
Created May 7, 2011 02:35
Nested pseudoclass selectors
li:first-of-type {
background: darken(yellow, 50%);
&::before {
content: "FIRST";
}
}
@cbfrance
cbfrance / taps via heroku gem
Created May 1, 2011 23:13
I think this convenience of moving databases with a one-liner is one of the things that made web development the most fun in 2010. I do this every day in ruby (taps gem and heroku gem) and php (drush).
[[email protected] ~/git/meedan-dev]
[(master)] >
$ heroku db:pull
Loaded Taps v0.3.23
Auto-detected local database: sqlite://db/development.sqlite3
Warning: Data in the database 'sqlite://db/development.sqlite3' will be overwritten and will not be recoverable.
! WARNING: Potentially Destructive Action
! This command will affect the app: meedan-dev
! To proceed, type "meedan-dev" or re-run this command with --confirm meedan-dev
// ========================================================================================
// MARKUP
// div.row
// div.row_ar or div.row_en <------ (1 main language per row)
// div.column_ar and div.column_en <------ (2 language columns per row)
!meta_header_height = 55px
=headline_big_type(!from="right")
a
@cbfrance
cbfrance / ahh
Created January 16, 2011 00:35
the joys of using compass: subtle shading with css3
@import "compass/css3";
$lightcolor: #ffffcc;
@include linear-gradient(color_stops($lightcolor,darken($lightcolor,5%)));