- Start a Sinatra server on port 4000
- GET / to that server triggers a
git pull
and mod_rails restart - Hit port 4000 locally after pushing
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
# RSpec | |
require 'spec/expectations' | |
# Webrat | |
require 'webrat' | |
require 'test/unit/assertions' | |
World(Test::Unit::Assertions) | |
Webrat.configure do |config| |
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) Put terminal_clone_tab.sh somewhere in | |
your path and make sure it is executable | |
chmod u+x terminal_clone_tab.sh | |
2) Then add the following alias (~/.bash_profile or something) | |
alias nt='terminal_clone_tab.sh' | |
3) Then you can hit nt (for new tab) anywhere | |
and a new tab will open up in same directory. | |
If there is an easier way to do this, let me know [email protected]. |
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
init = Rails::Initializer.run do |config| | |
#... | |
end | |
# look for all existing loaded plugin's public/ directories | |
plugin_assets = init.loaded_plugins.map { |plugin| File.join(plugin.directory, 'public') }.reject { |dir| not (File.directory?(dir) and File.exist?(dir)) } | |
init.configuration.middleware.use MyApp::Rack::StaticOverlay, :roots => plugin_assets |
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) Add the function below into your .bash_profile, .bash_login, or other shell profile file. | |
2) Then you can hit nt (for new tab) anywhere | |
and a new tab will open up in same directory. | |
All credit for the idea and applescript goes to @jnunemaker - I just tidied it up. | |
If you can improve it further, let him know -- [email protected]. |
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
(function($) { | |
// errors is an array of errors | |
// render :json => {:errors => @item.errors.full_messages} | |
function FormErrors(errors) { | |
var self = this, | |
error_count = errors.length; | |
this.html = function() { | |
var html = ''; | |
html += '<div class="errorExplanation" id="errorExplanation">'; |
NewerOlder