If you need to enable NewRelic monitoring on certain machines within the same Rails environment, a simple solution is to...

...caused by the random order of hash elements of the params hash. class Feedback belongs_to :user def role=(value) @role = value self.email = find_email_by_name(user.name) end

...work on a large application where a lot of code depends on the indeterministic behavior above, and it would be too much work to refactor the whole app for a...

...error" message: *** [err :: example.com] There are no Phusion Passenger-served applications running whose paths begin with '/var/www/example.com'. *** [err :: example.com] This is just because there were no running passenger process for...

Xfce gives you a million options to configure your panels. Together with Xfce's sometimes arcane configuration UI, this can...

makandra dev

Git has two kind of tags: annotated lightweight Annotated tags are stored as full objects in the Git database. They...

api.jquery.com

jQuery's removeClass removes the given class string from an element collection. If you want to remove multiple/unknown classes matching...

github.com

...JSON generation from a large, nested Ruby hash down from 200ms to 2ms. Its behavior differs from the default JSON.dump or to_json behavior in that it serializes Ruby symbols...

There are different ways to run rake: On Rails 4.1+ projects, you have Spring and its binstubs which dramatically improve...

makandra dev

The bash offers control over the behavior of autocompletion. The most primitive example is this (just run it in your bash; if you want it available everywhere, put the complete...

...pattern and many more. complete -p gives you a list of currently defined autocompletions. Behold, thou might not define multiple completions for one command. I recently built a script that...

makandra dev

...For this reason it is recommended to use a dev server during development. This behavior can be disabled by the compile: true setting in config/webpacker.yml. Note that this can also...

...searched for executables, CDPATH contains the list of directories that are available for cd. Besides the current directory (.), you can add others to that. The trick is to add a...

...directory, always use a prefix for your bookmarks. @ works well. This has also has benefits for the usage with autocompletion. Example usage: >cd Projects/makandra-cards/ ./Projects/makandra-cards/ >mark @cards >cd ~ >pwd

If you are using Angular and want something like Rails' simple_format which HTML-formats a plain-text input into...

makandracards.com

If you get an error message like this: You have already activated some-gem 1.2.3, but your Gemfile requires some...

...session using the database. This could be the rails server, rubymine and many more. Beside terminating the session connection manually you can also find out the pid and kill the...

This is a bookmarklet you can add to Chrome or Firefox which will allow you to create a story in...

To parse XML-documents, I recommend the gem nokogiri. A few hints: xml = Nokogiri::XML(" foo bar ") parses an xml...

makandra dev

...you usually group tasks by their domain/scope. An example crontab might look like this: # Begin Whenever generated tasks for: project100 MAILTO="log@example.com" MAILFROM="cron@example.com" # When server is booting up, ensure...

askubuntu.com

While the hardware mute button of my Lenovo x230 worked on Ubuntu 14.04 out of the box, it does not...

Some older Node modules rely on window.jQuery to be present. One suggested solution is to use this config in the...

makandra dev
plugins.jquery.com

SudoSlider is a simple yet powerful content slider that makes no (or very few) assumptions about your markup and is...

When working with large Sass files you will notice that the first request after a change to a Sass file...

At times, it might be unavoidable to have different CSS rules for Internet Explorer than for sane browsers. Using Sass...

For two years we've been using SearchableTrait which gives models the ability to process Googlesque queries like this: Contact.search...

OAuth requires a set of params to be carried along requests, among which a nonce. Some libraries pass these along...