This file contains hidden or 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
$responsive-small-width: 480px !default | |
$responsive-medium-width: 768px !default | |
$responsive-slow-device-width1: 480px !default | |
$responsive-slow-device-width2: 1024px !default | |
$responsive-fast-device-width: 1024px !default | |
// This mixin is to be used a bit like at-breakpoint from Susy [1] or the | |
// breakpoint mixin from CSS Tricks [2], however it reduces repetition in the | |
// outputted css by allowing you to pass several breakpoint names at once and | |
// compiling a media query that matches any of them, for your content. |
This file contains hidden or 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 | |
%head | |
%title Report on Things and Stuff | |
%style | |
:sass | |
body | |
font-family: 'Helvetica Neue', Helvetica, sans-serif | |
color: #333 | |
margin: 10px auto 50px auto | |
width: 720px |
This file contains hidden or 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
#/usr/bin/env ruby | |
COLORS = [ | |
RED = "\e[01;31m", | |
GREEN = "\e[01;32m", | |
YELLOW = "\e[01;33m", | |
BLUE = "\e[01;34m", | |
PINK = "\e[01;35m", | |
CYAN = "\e[0;36m", | |
GRAY = "\e[01;30m", |
This file contains hidden or 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
#/usr/bin/env ruby | |
COLORS = [ | |
RED = "\e[01;31m", | |
GREEN = "\e[01;32m", | |
YELLOW = "\e[01;33m", | |
BLUE = "\e[01;34m", | |
PINK = "\e[01;35m", | |
CYAN = "\e[0;36m", | |
GRAY = "\e[01;30m", |
This file contains hidden or 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
1.9.3-p125 :001 > 1.week | |
=> 7 days | |
1.9.3-p125 :002 > Rails.version | |
=> "3.2.2" | |
1.9.3-p125 :003 > |
This file contains hidden or 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
gem 'haml-rails', '~> 0.3' | |
gem 'rails', '~> 3.1' | |
group :assets do | |
gem 'compass', '~> 0.11' | |
gem 'sass-rails', '~> 3.1' | |
gem 'coffee-rails', '~> 3.1' | |
gem 'uglifier', '~> 1.0' | |
end |
This file contains hidden or 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
create_table "line_items", :force => true do |t| | |
t.integer "cost" | |
t.boolean "paid" | |
t.integer "order_id" | |
end | |
create_table "orders", :force => true do |t| | |
end | |
# ----- |
This file contains hidden or 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
:javascript | |
Shining.config({...}) | |
#first | |
%h1 Hi there world | |
%p Yes this is a slide | |
%p.step with a step | |
:javascript | |
// stuff for the first slide | |
:css |
This file contains hidden or 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
describe 'rsync' do | |
it 'should keep the latest version of a file' do | |
system("mkdir -p d1 d2") | |
begin | |
system("echo 'This is the first version' > d1/file.txt") | |
sleep 1 # ensure timestamps are different | |
system("echo 'This is the second version' > d2/file.txt") | |
system("rsync -ru d2/ dest/") | |
system("rsync -ru d1/ dest/") | |
File.read('dest/file.txt').should include('second version') |
This file contains hidden or 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
# Is there a preferred way to do it? A lot of people I see use inject, but it makes my eyes bleed. | |
x = [[1, 2], [3, 4]] | |
p x.inject({}) { |h, r| h[r[0]] = r[1]; h } | |
# {1=>2, 3=>4} | |
p Hash[*x.flatten] | |
# {1=>2, 3=>4} |