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
| var email_regexp = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i; | |
| jQuery.validator.addMethod("string_of_emails", function(value, element) { | |
| var emails = value |
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
| Given a product_trial_with_pictures exists with active: true # features/step_definitions/pickle_steps.rb:4 | |
| Too many open files - /var/folders/68/68gISV62GsmvDwtoiDeSfU+++TQ/-Tmp-/dragonfly20110328-369-1shyiuf-0 (Errno::EMFILE) | |
| /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1262:in `initialize' | |
| /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1262:in `open' | |
| /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1262:in `copy_file' |
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
| var default_options = {}; | |
| var hamsterDance = function(options) { | |
| options = options || {}; | |
| options.merge(default_options) | |
| // make the hamsters dance with appropriate options | |
| } | |
| // where i would google around for the best merge technique available since there doesn't seem to be a pattern for that either |
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
| var form_not_submitted = true; | |
| $( function() { | |
| $("form").validate({ rules: {...}, submitHandler: submitOnce}); | |
| }) | |
| var submitOnce = function(form) { | |
| if ( form_not_submitted ) | |
| { form_not_submitted = false; alert('hi'); form.submit(); } | |
| else { return false } |
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
| $.ajax({ url: this.action+'.json', | |
| dataType: 'json', | |
| accepts: 'text/json', | |
| data: $(this).serialize(), | |
| type: 'post', | |
| success: function(data, textStatus, XMLHttpRequest) { ... }}) | |
| // this works in all browsers except IE.. when sent from IE the server thinks it's asking for a mimetype of image/gif | |
| // i have tried all combinations of including and excluding "accepts", "dataType", and adding ".json" onto the end of the form action. |
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
| .arrow | |
| font-size: 0px | |
| line-height: 0% | |
| width: 0px | |
| border-top: 5px solid #f6f6f6 | |
| border-left: 10px solid #77c | |
| border-bottom: 5px solid #f6f6f6 | |
| th.headerSortUp .arrow |
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
| namespace :deploy do | |
| [:start, :stop].each do |t| | |
| desc "#{t} task is a no-op with passenger" | |
| task t, :roles => :app do ; end | |
| end | |
| 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
| /Users/dancarper/.irbrc:2:in `<main>': no such file to load -- ap (LoadError) | |
| from /usr/local/bin/macirb:36:in `block' | |
| from /usr/local/bin/macirb:9:in `block' | |
| from /usr/local/bin/macirb:7:in `<main>' |
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 index | |
| @comments = .... | |
| respond_to do |wants| | |
| wants.json { render :json => { :comments => render_to_string(:partial => 'comments/comments_box.html.haml', :locals => { :comments => @comments}) }.to_json } | |
| end | |
| 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
| class Album < ActiveRecord::Base | |
| attr_accessible :title | |
| has_one :artist , :dependent => :destroy | |
| has_many :genres , :dependent => :destroy | |
| accepts_nested_attributes_for :artist, :allow_destroy => true | |
| end |