Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Frain benfrain

View GitHub Profile
@mirisuzanne
mirisuzanne / type.scss
Created Sep 2, 2012
Using modular scale with vertical rhythms
View type.scss
// Using the Modular Scale plugin along with Compass Vertical Rhythms module.
// The goal is to use MS to give us the values,
// and use VR to apply those values to our typography.
// ---------------------------------------------------------------------------
// Defaults
$base-size: 24px;
$ratio: major-third() fifth();
@ls-lukebowerman
ls-lukebowerman / sitemap.xml.erb
Created Aug 7, 2012
Sitemap (sitemaps.org) generator for Middleman
View sitemap.xml.erb
<% pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) } %>
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<% pages.each do |p| %>
<url>
<loc>http://youdomain.com/<%=p.destination_path.gsub('/index.html','')%></loc>
<priority>0.7</priority>
</url>
<% end %>
</urlset>
@benfrain
benfrain / gist:3011711
Created Jun 28, 2012
Sublime Text 2 - Useful Shortcuts
View gist:3011711

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘⌃P go to project
⌘KB toggle side bar
⌘⇧P command palette

Selection

@mrinalwadhwa
mrinalwadhwa / data_url.rb
Created Jun 20, 2012
SCSS custom function to insert data uri into style sheets.
View data_url.rb
require 'base64'
# tools.ietf.org/html/rfc2397
# developer.mozilla.org/en/data_URIs
# "data:" + MIME type + ";base64," + base64-encoded content
def to_data_url(content, content_type)
outuri = 'data:' + content_type + ';base64'
content = Base64.encode64(content).gsub("\n", '')
outuri += ",#{content}"
@lucasfais
lucasfais / gist:1207002
Created Sep 9, 2011
Sublime Text 2 - Useful Shortcuts
View gist:1207002

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