This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The base fontsize you want to use. | |
$browser-context: 16 | |
@function rem($pixels, $context: $browser-context) | |
@if unitless($pixels) | |
$pixels: $pixels * 1px | |
@if unitless($context) | |
$context: $context * 1px | |
@return $pixels / $context * 1rem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
formatDate = function(date, pretty) { | |
var dd = date.getDate(); | |
var mm = date.getMonth()+1; //January is 0! | |
var yyyy = date.getFullYear(); | |
if(dd<10) { | |
dd='0'+dd | |
} | |
if(mm<10) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'net/http' | |
def remote_file_exists?(url) | |
url = URI.parse(url) | |
Net::HTTP.start(url.host, url.port) do |http| | |
return http.head(url.request_uri)['Content-Type'].start_with? 'image' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
%head | |
%meta{:charset => 'utf-8'} | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
%title | |
= current_page.data.title || "The Middleman" |