View tache-layouts.rb
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 'tache' | |
layout = <<-eos | |
<html> | |
<head> | |
<title>{{#layout.title}}Default Title{{/layout.title}}</title> | |
</head> | |
<body> | |
{{#layout.content}}Default Content{{/layout.content}} | |
</body> |
View gist:7237043
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
<!-- Suck on this BEM! --> | |
<section aria-labelledby="latest-products"> | |
<h2 id="latest-products">Latest Products</h2> | |
<ul> | |
... | |
</ul> | |
</section> | |
<section aria-labelledby="press-news"> |
View issue-3144.rb
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
Mongoid.connect_to 'mongoid-3144' | |
class Post | |
include Mongoid::Document | |
field :name | |
embeds_many :comments | |
accepts_nested_attributes_for :comments | |
# This line somehow triggers the bug; commenting it out fixes the bug, wierd. |
View osx-tabs.sh
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
function tabname { | |
# Will use current dir name if called without arg. | |
printf "\e]1;${1-$(basename `pwd`)}\a" | |
} | |
function winname { | |
# Will use current dir name if called without arg. | |
printf "\e]2;${1-$(basename `pwd`)}\a" | |
} | |
function tab { | |
# Will cd into current dir if called without arg. |
View scale.scss
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
// Example usage: | |
// $size-1: 13; | |
// $size-2: 15; | |
// $size-3: golden($size-1, 1); | |
// $size-4: golden($size-2, 1); | |
// $size-5: golden($size-1, 2); | |
// $size-6: golden($size-2, 2); | |
// | |
// In conjunction with rhythm (https://gist.github.com/thelucid/5730434): | |
// @include font($size-3); |
View rhythm.scss
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
$rhythm-base: 16; | |
$rhythm-size: 26; | |
// Converts any non-zero, unitless number values from pixels to rems | |
// with a pixel fallback for old browsers. | |
// | |
// Example: | |
// @include rem('padding', 32 5%); | |
// | |
// Output: |
View gist:4437186
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 'tache/safe' | |
# ORM-like base class | |
class Model | |
def initialize(attributes = {}) | |
attributes.each { |key, value| send "#{key}=", value } | |
end | |
def destroy | |
'Successfully destroyed!' |
View gist:4436684
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 'tache/safe' | |
# ORM-like base class | |
class Model | |
def initialize(attributes = {}) | |
attributes.each { |key, value| send "#{key}=", value } | |
end | |
def destroy | |
'Successfully destroyed!' |