Skip to content

Instantly share code, notes, and snippets.

View scottboms's full-sized avatar
👀

Scott Boms scottboms

👀
View GitHub Profile
@codingdesigner
codingdesigner / gist:1259587
Created October 3, 2011 16:53
convert px to em in sass
// convert px to em in sass.
// $target-px: the value you want to convert
// $context: the current pixel value of 1em
@function calc-em($target-px, $context) {
@return ($target-px / $context) * 1em;
}
@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"); }
}
@enaeher
enaeher / tiered_archives.rb
Created September 5, 2011 21:49
Tiered Archives plugin
# A quick and dirty plugin for Jekyll by Eli Naeher
#
# This plugin creates a site.years template variable which allow you to group archive links by year and month.
# The structure of site.years is:
# site.years = 2001=>[[post1, post2...], [...]], 2002=>[...]
#
# Usage should look something like this:
# {% for year in site.years %}
# <h2>Year {{ year.first.first.date | date: "%Y" }}</h2>
@dpk
dpk / gist:1027863
Created June 15, 2011 19:21
LESS CSS FCGI script. Using this with a FastCGI server will mean you can serve your LESS files directly as CSS, compiling them on-the-fly as a request is made. Uses the content of the LESS source file to generate an Etag for Validation caching.
#!/usr/bin/ruby
require 'fcgi'
require 'less'
require 'digest/sha1'
FCGI.each do |request|
out = request.out
source = File.new(request.env["SCRIPT_FILENAME"], 'r').read;
hash = Digest::SHA1.hexdigest(source).inspect
@splorp
splorp / gist:776730
Created January 12, 2011 19:36
Preferences to disable local storage in Safari
# To disable Safari’s annoying modal local database
# storage dialog, use this Terminal command:
defaults write com.apple.Safari WebKitDatabasesEnabledPreferenceKey -bool false
# To disable local storage altogether, use this command:
defaults write com.apple.Safari WebKitLocalStorageEnabledPreferenceKey -bool false
@edavis10
edavis10 / _config.yml
Created November 6, 2009 02:18
Pagination in Jekyll
# ....other stuff here
paginate: 10