Skip to content

Instantly share code, notes, and snippets.

View scottkellum's full-sized avatar
🕴️
Working on Typetura

Scott Kellum scottkellum

🕴️
Working on Typetura
View GitHub Profile
@jackie
jackie / breakpoints.json
Last active December 19, 2015 15:28
Sass Script function to get breakpoint values from a JSON file.
{
"phone" : "all and (max-width: 603px)",
"desktop": "all and (min-width: 1025px)",
"tablet" : "all and (min-width: 604px) and (max-width: 1024px)"
}
@ls-lukebowerman
ls-lukebowerman / sitemap.xml.erb
Created August 7, 2012 17:59
Sitemap (sitemaps.org) generator for Middleman
<% 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>
@madrobby
madrobby / gist:3201472
Created July 29, 2012 19:50
Check if the browsers supports SVG
// comments welcome, there may be better ways to do this!
function supportsSVG(){
return !!('createElementNS' in document &&
document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect)
}
@micahgodbolt
micahgodbolt / gist:2936775
Created June 15, 2012 14:36
Proposed Susy syntax to create "The Fonmon" asymmetric grid layout
//Proposed Susy syntax to create "The Fonmon" asymmetric grid layout. http://gridsetapp.com/specs/fonmon.php?gridset=show
$total-columns: 5;
$column-width: 200px, 96px, 96px, 96px, 200px;
// could use relative units: 1, 1 would be 50/50%. 1, 2 would be 33/66%, 1, 1, 1 would be 33/33/33%
$columns: column padding, column padding, column padding, column padding, …; //suggested multi dimensional syntax
$gutter-width: 30px;
@necolas
necolas / _mixin-better.scss
Created April 13, 2012 15:52
Sass grid construction
// Still need to work out how to combine rules for numbers
// that share a greatest common factor without the unit-builder
// actually containing the fraction to which they can both be
// reduced.
// Calculate the greatest common factor of two integers
@function gcf($a, $b) {
@if $b == 0 {
@return $a;
}
@mirisuzanne
mirisuzanne / 1_index.html
Created April 4, 2012 22:58
Suggested syntax for responsive Susy layouts
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<link rel="stylesheet" href="stylesheets/screen.css">
</head>
<body>
<div class="container c1"></div>
<div class="container c2"></div>
module Sass::Script::Functions
def random(max = Sass::Script::Number.new(100))
Sass::Script::Number.new(rand(max.value), max.numerator_units, max.denominator_units)
end
end