Skip to content

Instantly share code, notes, and snippets.

View scottboms's full-sized avatar

Scott Boms scottboms

View GitHub Profile
@edavis10
edavis10 / _config.yml
Created November 6, 2009 02:18
Pagination in Jekyll
# ....other stuff here
paginate: 10
@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
@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
@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>
@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"); }
}
@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;
}
@aarongustafson
aarongustafson / responsive-iframes.css
Created October 25, 2011 17:07
Responsive iFrames with jQuery
iframe {
max-width: 100%;
}
@gferreira
gferreira / interpolated-nudge-dialog.py
Created January 4, 2012 06:44
interpolated nudge dialog
# [h] interpolated nudge dialog
'''a simple RoboFont dialog for the famous "interpolated nudge" script'''
# Interpolated Nudge for RoboFont -- Travis Kochel
# http://tktype.tumblr.com/post/15254264845/interpolated-nudge-for-robofont
# Interpolated Nudge -- Christian Robertson
# http://betatype.com/node/18
@boucher
boucher / StripeTutorialPage.html
Created February 6, 2012 07:05
Stripe Tutorial Payment Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
// this identifies your website in the createToken call below
@jcroft
jcroft / layout.sass
Created March 1, 2012 04:51
How easy responsive design can be with Sass
#content-wrapper
+container
#about
// Default (smallest screens)
+column(100%)
background-color: #ccc
// Respond to other screen widths