...Text bundle offers a command Remove Trailing Spaces in Document / Selection, which you can call before saving. This is not aware of git (i.e., which lines YOU have edited).

...a shortcut like Cmd + Alt + Backspace. Update: Since 9-29-2012, TextMate2 has a callback will-save. In the above command, set 'Semantic class' to callback.document.will-save, and it will...

markodenic.com

Table of content for the linked article: 1. The `loading=lazy` attribute 2. Email, call, and SMS links 3. Ordered lists `start` attribute 4. The `meter` element 5. HTML Native...

ruby-doc.org

This class contains nerdcore things such as disassembling a piece of Ruby into VM calls or enabling tail-call optimization. Also see this article about enabling TCO on a per...

...to serve too many masters. E.g. we are adding a lot of logic and callbacks for a particular form screen, but then the model becomes a pain in tests, where...

...all those callbacks just get in the way. Or we have different forms for the same model but they need to behave very differently (e.g. admin user form vs. public...

...tags and triggers. Tips for implementing tracking with Google Analytics Each kind of tracking calls needs its own tag, e.g. "filter toggled", "load more clicked", "page view" etc.

...inject Javascript. Useful for e.g. defining a GA Opt-Out function that can be called e.g. from a link with href="javascript:gaOptOut()" Tracking tags should have an exception trigger...

makandra dev

Other html stuff If there is only one fragment to cache you can call the cache method inside your view without any parameters. Then it will automatically use the...

...do |expected_column| row.any?{ |column| column.include?(expected_column) }.should be_true end end end Call it like Then I should see the following users table: | Name | Is Admin? | | Alice | Yes...

...is cached somewhere so you only need to write them once. To reconfigure later, call s3cmd --configure. Once you're done setting up, s3cmd gives you shell-like commands like...

...crash when Power.current is nil. This is the case when your model isn't called as part of processing a browser request, e.g. on the console, during tests and during...

...a long selection of class methods that behave neutrally in case Power.current is nil: Call Equivalent Power.for_model(Note) Power.current.present? ? Power.current.notes : Note Power.for_model(:updatable, Note) Power.current.present? ? Power.current.updatable_notes : Note...

makandra dev

...to look into this helper script. You don't need to change stuff that calls rake because rake is already Bundler-aware. Bundler replaces the Cucumber version hack

See this note Kernel#returning has been deprecated in favor of Object#tap. (called from enable_activerecord at /.../gems/will_paginate-2.3.14/lib/will_paginate.rb:39) Update will_paginate gem to version >= 2.3.15

...Use #listify instead. Using #request_uri is deprecated. Use fullpath instead Upgrade gems that call #request_uri. Some gems that do this (like ssl_requirement) are no longer maintained. In...

skorks.com

...the last argument of the previous command. Example: Check with "ls foo*" first and call "mv !$ /tmp" afterwards. Combined commands Ctrl + (C P O) Cancel the running command, go to...

...and waited until the debugger was triggered In the debugger we looked up the caller by first running raise, then wtf???????????? in pry (wtf is a pry command, the more...

end Be aware that it will run some_expensive_calculation every time you call var_value if some_expensive_calculation returns nil. This illustrates the problem: def some_expensive...

...is the essential implementation. Remember In the above example, some_expensive_calculation is never called again. This might be what you want, but if you are looking for something in...

makandra dev

...former value) after the block has ended. A nice shortcut is that when you call with_power with an argument that is not already a Power, Consul will instantiate a...

.../spellcheck31/wscbundle/wscbundle.js is loaded as described in the docs. To activate WProofreader, you can now call WEBSPELLCHECKER.init on CKEditor's iframe (not the textarea). Note that you should be using CKEDITOR.replace...

...initializer that cleans up line breaks: module ActionController module Session CookieStore.class_eval do def call_with_line_break_fix(*args) status, headers, body = call_without_line_break_fix(*args) headers...

...n", "\n" if headers['Set-Cookie'].present? [ status, headers, body ] end alias_method_chain :call, :line_break_fix end end end Put that into a file like config/intializers/cookie_store_with_line_break_fix.rb and you...

makandra dev

...of arguments (given 1, expected 0) Use procs instead of lambdas where they are called with variable arguments. Look for named_scopes. Error: Attempt to call private method, NoMethodError

...they are not aliased), update has been changed on SessionHash. SessionHash#load_for_write! calls load! internally which prepares some data in the session hash. The same happens when you...

...you need to tell it which Firefox to use for Selenium tests. If you call Cucumber using the cuc script (also part of the geordi gem), this will happen automatically...

The associated record has its own universe of things; when delegating calls to it, you ca not stub methods on the associated record and expect them to...

...Its real class is ActiveRecord::Associations::BelongsToAssociation which is sometimes exposed, for example when calling undefined methods: post.thread.foobar NoMethodError Exception: undefined method `foobar' for # This means that you actually stubbed...

...Gemfile.something and a .bundle directory. The contents of the .bundle directory redirect all gem calls to another configuration in the Gemfile.something directory, preventing your application from seeing the gems it...

...you can take any scope and extend it with additional joins or conditions. We call this chaining scopes. In practice chaining becomes problematic when scope chains grow more complex. In...

...record's ID is among them. This list of IDs is cached for subsequent calls, so you will only touch the database once. As scary as it might sound, fetching...