gem install rails --pre
rails new my_app -T
require "net/http" | |
require "enumerator" | |
# Example Usage: | |
# | |
# use Rack::Proxy do |req| | |
# if req.path =~ %r{^/remote/service.php$} | |
# URI.parse("http://remote-service-provider.com/service-end-point.php?#{req.query}") | |
# end | |
# end |
$default_rounded_amount: 5px | |
// Round corner at position by amount. | |
@mixin round-corner($position, $amount: $default_rounded_amount) | |
border-#{$position}-radius: $amount | |
-webkit-border-#{$position}-radius: $amount | |
@mixin round-corner-mozilla($position, $amount: $default_rounded_amount) | |
-moz-border-radius-#{$position}: $amount | |
// Round left corners by amount |
!!! 5 | |
%html | |
%head | |
%title= "Your Website" | |
%meta{ :content => "", :name => "description" } | |
%meta{ :content => "", :name => "author" } | |
%meta{ :content => "3 days", :name => "revisit-after" } | |
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" } | |
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" } | |
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" } |
// All navigation that is relative should be passed through the navigate | |
// method, to be processed by the router. If the link has a `data-bypass` | |
// attribute, bypass the delegation completely. | |
$(document).on("click", "a[href]:not([data-bypass])", function(evt) { | |
// Get the absolute anchor href. | |
var href = { prop: $(this).prop("href"), attr: $(this).attr("href") }; | |
// Get the absolute root. | |
var root = location.protocol + "//" + location.host + Application.root; | |
// Ensure the root is part of the anchor href, meaning it's relative. |
<!DOCTYPE html> | |
<meta charset=utf-8> | |
<meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1"> | |
<meta name=apple-mobile-web-app-capable content=yes> | |
<meta name=apple-mobile-web-app-status-bar-style content=black> | |
<title>Test fullscreen</title> | |
<style> | |
html, body { | |
margin: 0; | |
padding: 0; |
This gist is no longer valid. Please see Compass-Rails for instructions on how to install.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Testing Pie Chart</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script> | |
<style type="text/css"> |
n = Notification::Answer.new | |
n.class.name.split('::').last || '' | |
# => "Answer" | |
n.class.name.split('::').first || '' | |
# => "Notification" |
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" |