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
#!/bin/bash | |
COOKIE_JAR="ab-cookie-jar" | |
COOKIE_NAME="_myapp_session" | |
USERNAME="[email protected]" | |
PASSWORD="password" | |
LOGIN_PAGE_URI="http://localhost:3000/users/sign_in" | |
TEST_PAGE_URI="http://localhost:3000/dashboard" | |
echo "Logging in and storing session id." |
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
# Configure Rack middleware | |
config.middleware.insert_before 0, 'WwwRedirect' |
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
# QuickLeft theme for oh-my-zsh. | |
# Requires rvm or rbenv plugin (rbenv plugin - https://github.com/robbyrussell/oh-my-zsh/pull/670) | |
DEFAULT_TEXT_COLOR=$fg[white] | |
PROMPT_PREFIX_COLOR=$fg[white] | |
PROMPT_SUFFIX_COLOR=$fg[blue] | |
PROMPT_DIR_COLOR=$fg[yellow] | |
RUBY_PROMPT_COLOR=$fg[blue] | |
RUBY_PROMPT_INFO_COLOR=$fg[yellow] | |
GIT_PROMPT_COLOR=$fg[blue] |
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
## Prepare ################################################################### | |
# Remove RVM | |
rvm implode | |
# Ensure your homebrew is working properly and up to date | |
brew doctor | |
brew update | |
## Install ################################################################### |
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 install hpricot | |
gem install ruby_parser | |
# Find and list erb templates to convert, but don't convert | |
find . -name '*erb' | xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}' | |
# Find and convert erb to haml, (won't delete your erb) | |
find . -name '*erb' | xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}' | bash |
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
module Heroku | |
class StaticAssetsMiddleware | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
# call returns an array containing [response code, header, Rack::Response] | |
reply = @app.call(env) |
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
$ heroku db:pull | |
... | |
Receiving schema | |
Schema: 100% |==========================================| Time: 00:00:00 | |
Receiving indexes | |
users: 100% |==========================================| Time: 00:00:01 | |
orders: 100% |==========================================| Time: 00:00:00 | |
Receiving data | |
2 tables, 300 records | |
Resetting sequences |
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
/* Flashes | |
-------------------------------------------------------------- */ | |
.js #flash { | |
display: none; | |
} | |
#flash { | |
position: absolute; | |
width: 100%; | |
z-index: 10000; |
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
-# mathiasbynens.be/notes/async-analytics-snippet | |
:javascript | |
var _gaq=[['_setAccount',"#{ENV['GOOGLE_ANALYTICS_ID']}"],['_trackPageview']]; | |
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1; | |
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; | |
s.parentNode.insertBefore(g,s)}(document,'script')); |
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
-# Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if needed | |
%script{:src => "//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"} | |
:javascript | |
!window.jQuery && document.write('<script src="/javascripts/jquery.min.js"><\/script>') |