Skip to content

Instantly share code, notes, and snippets.

View stevenringo's full-sized avatar

Steven Ringo stevenringo

View GitHub Profile
%p
Blah blah blah blah
%a(href='#foo') foo
and
%a(href='#bar') bar
\.
-# The problem with the above Haml fragment is that I am left with a space after <a href='#bar'>bar</a> and before the period.
-# Haml's whitespace removal does not resolve the issue, because it can either remove ALL whitespace
-# around an element or ALL whitespace within an element. Neither option seems to fit the bill.
/ http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#whitespace_removal__and_
/ Use like so
%p
Blah blah blah blah
%a(href='#foo') foo
%a(href='#bar')> bar
\.
@stevenringo
stevenringo / install_homebrew.rb
Created August 30, 2011 10:46 — forked from mxcl/install_homebrew.markdown
Installs Homebrew to /usr/local with version before it broke
#!/usr/bin/ruby
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like.
module Tty extend self
def blue; bold 34; end
def white; bold 39; end
def red; underline 31; end
def reset; escape 0; end
def bold n; escape "1;#{n}" end
@stevenringo
stevenringo / .rspec
Created December 27, 2012 22:39 — forked from coreyhaines/.rspec
--colour
-I app
#!/bin/zsh
/usr/bin/vagrant destroy --force
yes | knife client delete {NODE_NAME}
yes | knife node delete {NODE_NAME}
/usr/bin/vagrant up
knife bootstrap localhost --node-name {NODE_NAME} --ssh-user vagrant --ssh-password vagrant --ssh-port 2222 --sudo
/usr/bin/vagrant provision
What's new in Ruby on Rails 4
A RoR 4 press review
Silvio Relli @ Florence On Ruby
Bibliography and related resources
1) Rails queue
http://reefpoints.dockyard.com/ruby/2012/06/25/rails-4-sneak-peek-queueing.html
http://blog.remarkablelabs.com/2012/12/rails-queue-rails-4-countdown-to-2013
https://github.com/rails/rails/commit/adff4a706a5d7ad18ef05303461e1a0d848bd662
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
require 'yaml'
require 'erb'
require 'ostruct'
class Settings < OpenStruct
# Settings.new(:google_analytics)
def initialize(config_file_base_name)
super(YAML.load(ERB.new(File.read(Rails.root.join("config", "#{config_file_base_name}.yml"))).result)[Rails.env])
end
---
- name: Deploy new site release
user: deployer
hosts: all
tasks:
- name: Fetch repo updates
git: >
[email protected]:my/repo.git