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...

...a Pull Request on GitHub that includes commits from another Pull Request, you will still see them after the "child" PR has been merged. Unfortunately, GitHub won't automatically update...

Check out the target branch git checkout my-target-branch Make sure you are up to date against origin (e.g. git fetch and git status). You should...

.../.bashrc to have it always available. Adjust to your needs. Usage $> tab_title # title set to the current directory's name $> tab_title new_title # title set to "new_title...

...Auto-setting the title If you want your title to update each time you change the working directory, put this code after the function definition. # auto-title cd() { builtin cd...

github.com

...Its behavior differs from the default JSON.dump or to_json behavior in that it serializes Ruby symbols as ":symbol", and that it doesn't like an ActiveSupport::HasWithIndifferentAccess.

...want it to replace #to_json (but you can always just call Oj.dump explicitely). Security warning: Oj does not escape HTML entities in JSON Be aware that Oj.dump is not...

When you're writing specs for ActiveRecord models that use memoization, a simple #reload will not do: it 'updates on changes' do subject.seat_counts = [5] subject.seat_total.should == 5 # seat_total is...

...either memoized itself, or using some # private memoized method subject.seat_counts = [5, 1] subject.seat_total.reload.should == 6 # => Still 5 end You might be tempted to manually unmemoize any memoized internal method to...

Note that if you plan to downgrade Firefox because your Selenium tests broke after a Firefox upgrade, there is a better way that doesn't involve downgrading. Mozilla has stated...

...that they will no longer provide security patches for any but the most recent versions of Firefox. So running an old Firefox should not be a long-term solution for...

Sometimes, the IRB prints a warning during boot: irb: warn: can't alias source from irb_source. Explanation

...the IRB creates many aliases to give the user quick access to irb functions like source-ing a file. However, if IRB's context already responds to the alias it...

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...

...useful if, for example, you want to use a background-image that has to scale with the width and the div should only have the height of the picture.

.outer { width: 100%; background-image: image-url('background.png'); background-size: cover; } .inner { padding-top: 60%; } How does it work? There are several CSS attributes that can handle values as...

makandra dev
github.com

...Rails project that has been lying around for some time (git pull, bundle install, migrate) security-update: prepare and finish a security update by pulling/pushing/merging and deploying just as our...

...console staging shell: open a shell on a Capistrano target, optionally selecting the server with --select-server tests: run all employed tests; checks for: Cucumber, RSpec, Test::Unit and rake...

ChromeDriver clicking works by simulating a mouse click in the middle of the element's first client rect (or bounding client rect if it doesn't have a first client...

Another element which is now located at this position receives the click A step which finds and clicks the desired link via javascript may solve the problem:

Install FreeBSD Download a suitable image from this site Select File > New… to and follow the instructions, choose the .iso file you downloaded as image file Start the new virtual...

...and extract the VMWare tools cd /tmp tar zxpf /cdrom/vmware-freebsd-tools.tar.gz umount /cdrom # run installation script, # just confirm the default answers when asked cd vmware-tools-distrib/ ./vmware-install.pl Set screen resolution...

Use the following command to test if a server (in this example: makandra.com on port 443) uses Perfect Forward Secrecy (PFS): openssl s_client -connect makandra.com:443 -cipher ECDHE-RSA-RC4...

You should see something like the following: ~ > openssl s_client -connect projecthero.com:443 -cipher ECDHE-RSA-RC4-SHA CONNECTED(00000003) depth=1 O = AlphaSSL, CN = AlphaSSL CA - G2

Google Calendar integration into Thunderbird suddenly did not work any more for me. Thunderbird kept asking me for my password to access calendars, but did not show them when given...

Remove the Ubuntu packages the "Lightning" and "Google Calendar Provider" Thunderbird addons: ^ sudo apt-get remove xul-ext-gdata-provider xul-ext-lightning Restart Thunderbird Install the addons...

The following solution will delete files on a volume. If you don't know exactly what you're doing, you can run into big trouble with...

I play mp3 files on my car stereo that are stored on a SD-Card. When I've copied those mp3 files to the FAT formatted SD-Card...

Sometimes, through some firewall or proxy misconfiguration, you might have to deploy to a server that cannot access the git repository. Solution 1: HTTP Proxy (this is the preferred fix...

...SSH can be tunneled over an HTTP Proxy. For example, when the repo is on github, use this: Install socat Add a ~/.ssh/config on the target server(s) with permission...

...other attributes. A hack to fix this is to use faux string interpolation in a single-quoted :conditions string: class User < ActiveRecord::Base has_many :contracts has_one :current_contract...

...class_name => 'Contract', :conditions => '"#{Date.today.to_s(:db)}" BETWEEN start_date AND end_date' end The single quotes around the conditions are not a typo. It's to prevent Ruby from...

--without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/thomas/.rvm/rubies/ruby-1.8.7-p374/bin/ruby extconf.rb:15: undefined method `include_path' for Libv8:Module (NoMethodError) This is caused...

In order to fix that, remove all versions ob 'libv8': gem uninstall libv8 Select gem to uninstall: 1. libv8-3.3.10.2-x86_64-linux 2. libv8-3.11.8.17-x86_64-linux...

Let's say you want to merge the properties of two JavaScript objects: let a = { foo: 1, bar: 2 } let b = { bar: 3, baz: 4 } let merged = merge(a, b...

...foo: 1, bar: 3, baz: 4 } Depending on your build, there are several ways to implement merge(). When you have ES6 When you have an ES6 transpiler or don't...

...will allow you to use ssh from anywhere. Simply paste the information provided by vagrant ssh-config to your ~/.ssh/config-File: vagrant ssh-config >> ~/.ssh/config Example: $ vagrant ssh-config

...a desired state. Upon creation Vagrant will set up a new VM and add a SSH-Key so you can ssh into the machine. Normally you would switch to the...

...you register a delegated event using on (or the deprecated delegate / live), it is somewhat hard to manually trigger these events manually, e.g. for testing. After trying jQuery's trigger...

...to no avail, I had success by using native Javascript methods to create and dispatch an event. For instance, to trigger a mousedown event: element = $('...').get(0); event = new MouseEvent...

...wanted autocompletion for paths from paths.rb in Cucumber? This card lets you write your steps like this: When I go to path *press tab now* # path is replaced with a...

...list of all known Cucumber paths This is how you do it (key shortcuts apply for TextMate2) Open the bundle editor (ctrl + alt +  + B) Create a new Item ( + N), select...

While you can use Apache as a reverse proxy, it tries to be too smart. Try nginx instead, it's much simpler to set up. After struggling with Apache for...

...quite a while, since I simply could not make it pass through the Digest Authentication of my target host (that I proxied to), I switched to nginx. Here is what...

makandra dev

...entered the unmistakeable file extension like material_orders_controller.rb, this may help you: Causing the Problem Sometimes you create a new file and forget to enter the ending like material_orders_controller...

...Rubymine handles such files per default as simple txt files. You delete this file and create a new one with correct ending: material_orders_controller.rb. But still Rubymine treats this file as...