justinfrench.com

...behavior of deprecated code in your Ruby project, the warning messages littered throughout your spec output is incredibly noisy. You could silence all warnings with ::ActiveSupport::Deprecation.silenced = true, but you...

...dependencies. It’s tempting to remove the tests altogether (the code will be burned soon too, right?), but I figured out something a little nicer a little while back in...

...pattern below. The module pattern gives you basic class concepts like a constructor, private state, public methods. Since the module pattern only uses basic JavaScript, your code will run in...

...that we want to translate into Javascript using the module pattern. It's a simple class with one private function: # Ruby class Dog def initialize(name) @name = name

By default, Devise redirects to a sign-in form when accessing a route that requires authentication. If for some reason you do not want this, but use Basic Authentication (and...

...disable password reset. Note that forcing Basic Auth means there won't be a pretty sign-in form any more which would include a link for sign-up or password...

makandra dev
feedjira.com

...was missing some features on Ruby's RSS::Parser that I found in Feedjira: Speed Does not break on slightly malformed RSS feeds (like a missing length attribute on an...

makandra dev
chrome.google.com

When you're facing a somewhat complex Google Analytics setup and want to find out what's happening, you can use this Chrome extension. It's much simpler than other...

...like "Google Tag Assistant") and does just one job and does it well. To see what's happening, you need to open your developer console...

pivotaltracker.com

The team is responsible for building great software—that’s it. It’s the only thing the team is responsible for and it’s the only thing that they actually...

...control. In other words, the development team is committed to quality software...

timeless.judofyr.net

...unknown, technique in Ruby. For certain types of problems (e.g. when you have a set of rules) this gives you such an elegant way of describing the solution. There’s...

...no meta programming or monkey patching involved, it’s short and sweet and best of all: it’s very intuitive...

jamesgolick.com

Trample is a more flexible load simulator. Instead of a static list of urls, trample's configuration language is ruby. Using ruby's blocks (lambda functions), it's possible to...

blogs.concedere.net

The goal of modelling is to produce something substantially simpler than the world. This is achieved not through endlessly inventing new types and relationships -- in fact, it's just the...

...s by eliminating entities and restricting types that we get a model that's simpler than the world and thus useful...

TL;DR Debugging problems with javascript errors in cucumber tests is sometimes easier in the browser. Run the test, stop at the problematic point (with Then pause from Spreewald...

...and open VNC for Firefox. Features: It does not freeze your server like when you're using a debugger. (Compared to the Then console step) It enables interacting with the...

lucaguidi.com

...was typical approach for object oriented languages, designed in the 90s. A thread is sequence of instructions that can be scheduled and executed in the context of a process. Several...

...at the same time. Ruby’s VM process allocates a memory heap, which is shared and writable by threads. If incorrectly coordinated, those threads can lead to unexpected behaviors...

apidock.com

2.ordinalize # => "2nd" 1002.ordinalize # => "1002nd" 1003.ordinalize # => "1003rd" -11.ordinalize # => "-11th" -1001.ordinalize # => "-1001st...

Geordi uses parallel_tests if available for running the test suite. To debug an application it is very unhandy to have multiple processes as your terminal I/O will not work...

...as expected once a breakpoint is hit. Even parallel_tests support an option to enable a single process run, it is not possible to pass this option through geordi. But...

github.com

When CoffeeScript was added to Rails 3.1 they forgot one very important part, the ability to use it when responding...

...dependeny of capybara gem 'nokogiri', '< 1.6' # dependency of capybara gem 'rubyzip', '< 1' # dependency of selenium-webdriver, rubyzip 1+ requires Ruby 1.9 gem 'cucumber_factory' gem 'database_cleaner', '< 1'

...spinner', '~> 0.2.5' gem 'launchy', '~> 2.1.2' With these versions set, selenium-webdriver will be at version 2.35.1. This is because all later versions depend on rubyzip 1+. More info. After upgrading...

bugs.launchpad.net

Terminator has a cool feature that allows you to split your terminal into many panels and type in all of them at the same time. It's called broadcasting and...

...and could be very dangerous (e.g. if you're logged in to a production server in a terminal that is on another workspace). To prevent the broadcast from affecting other...

...class for the presenter instead of extending objects DCI-style. This allows them to add statically-defined callbacks and validations from ActiveModel with the syntax that we know and love...

...question: We should be clear about why a form model is a better place for screen-specific code than a plain old controller. Weren't controllers originally the place for...

awsdocs.s3.amazonaws.com

...aws-credential-file ./aws-credential.txt The output should look something like this: arn:aws:iam::322191361670:server-certificate/www.example.com arn:aws:iam::322191361670:server-certificate/testCert Now you have to upload...

...and includes the server certificate Amazon Resource Name (ARN) and GUID: arn:aws:iam::322191361670:server-certificate/www.example.com-2011 ASCACexampleKEZUQ4K If you got the error message similar to A client error...

...To reconfigure later, call s3cmd --configure. Once you're done setting up, s3cmd gives you shell-like commands like s3cmd ls or s3cmd del somefile.png. Here is a full list...

s3cmd accesslog s3://BUCKET Sign arbitrary string using the secret key s3cmd sign STRING-TO-SIGN Sign an S3 URL to provide limited public access with expiry

makandra dev

It's like a GUI for the famous git add [-p]. Select files with the up/down-keys and hit u for staging/unstaging the whole file Enter for showing the diff of...

j and k to navigate in the diff u again to stage/unstage chunks 1 to stage/unstage only lines \ to split large chunks F5 to refresh the view

github.com

FactoryBot allows a :class option to its factory definitions, to set the class to construct. However, this option is not supported for traits. Most often, you can just define a...

If you need/want to use traits instead (for example, it might make more sense semantically), you can not use a :class on a trait. In that case, use initialize...

Let's say you have two screens: Show a given project Show a report for all projects Ideally you want both screens to be handled by different controllers like this...

...action ProjectsController#report. But these are all unsatisfying. What you can do is wrap the sub-resource in a collection block like you would do with custom collection actions:

makandra dev

Using CSS sprites for background images is a technique for optimizing page load time by combining smaller images into a larger image sprite. There are ongoing arguments on how useful...

...this still is, as modern browsers become more comfortable to load images in parallel. However, many major websites still use them, for example amazon, facebook, or twitter.

We often use VCR to stub external APIs. Unfortunately VCR can have problems matching requests to recorded cassettes, and these issues are often hard to debug. VCR's error messages...

...any way it will assume an error, because it can not know how the system it mocks would answer a request it has not yet recorded. Some signs an error...