When your site is mapped into the URL-space of another server using mod_proxy, ProxyPass and ProxyPassReverse, all requests in your Apache logs are logged with the IP address...
...of the proxying server. The IP address of the original client doing the request is not logged, making it difficult to trace problems and run statistics. Short answer
When you have a pending Cucumber step (or feature) that also uses an existing VCR cassette, your pending test may fail at the very end with an error like this...
...often a good configuration. If you do not want to change your whole test suite's settings because of a pending test, you can disable this behavior for pending features...
Let's say you need to revert a migration that happened a while back. You'd create a new migration that removes what was added back then in the up...
...do that. Especially when the up/down paths already contained some logic (that executed update statements on the created column, for example), copying does not feel right. Someone already added the...
Yesterday I stumbled across a talk in which the guy mentioned module sub-classing. I was curious what you can do with it and found his blog post with a...
...cool example. It allows you to inject some state into the module you are including elsewhere. Check it out! class AttributeAccessor < Module def initialize(name) @name = name end def included...
JavaScript structures that include circular references can't be serialized with a"plain" JSON.stringify. Example: a = { name: 'Groucho' }; b = { name: 'Harpo', sibling: a }; a.sibling = b; Doing a JSON.stringify(a) will...
...throw an error: TypeError: Converting circular structure to JSON There is not much you can do about that except specifying a custom serializer function that detects and cleans up circular...
...does not need to, be your LVM group name): cryptsetup luksOpen /dev/sda5 some_name Since your encryption container most likely contains an LVM group (root + swap for example), enable the...
...mkdir /mnt/ext-root), and then mount /dev/mapper/LVM_NAME-root /mnt/ext-root GRUB It is possible that GRUB (your system loader) will pick up on the new LVM group and add an entry to your...
...video plattform ("mycustomtv") in one of our applications. I learned a lot about naming stuff. youtube_mycustomtv_chooser is a bad name for a directive. Why? if you add, for...
...example, other video systems like vimeo, the name of the method either lies or will get longer. if you replace one system, you will have to change the method and...
Spring is a Rails application preloader. When debugging e.g. the rails gem, you'll be wondering why your raise, puts or debugger debugging statements have no effect. That's because...
...Spring preloads and caches your application once and all consecutive calls to it will not see any changes in your debugged gem. Howto Disable spring with export DISABLE_SPRING...
When refactoring a sequence of steps to a new, more descriptive step, you can use the steps method and Ruby's %-notation like this: Given 'I have an article in...
steps %( When I go the article list And I open the first article And I press "Add to cart" ) end This way you can simply copy the...
CSS (+ some Javascript) framework, implementing Google's material design for static web pages. Can be used for plain websites without requiring a full blown Javascript framework, unlike the (also excellent...
...elements, or Angular material. Prelimiary impression: I would recommend against using it at this stage, for a couple of reasons: It is much less complete than you might expect from...
CustomLog "|/usr/sbin/rotatelogs /opt/www/awesome-project/log/access.%Y-%m-%d.log 86400" combined Adding that to your site's vhost will create log files that include the current date in their name, like...
...access.2011-04-20.log, without any need to restart the web server every night (like logrotate does). The last argument above is the rotation time in seconds -- here being...
...above should fix it for that one command. If you want to persist that setting, say the following. export LESSCHARSET=UTF-8 Put it into your ~/.bashrc and reopen all...
...terminals (or source ~/.bashrc in open terminals). Note that if you are having trouble with filenames, you should try changing git's core.precomposeunicode config setting...
Pie sometimes does not properly redraw elements upon changes. This often happens when the change comes from somewhere further up the DOM. Consider something like: Active element Inactive element
li .content { -webkit-box-shadow: #666 0px 2px 3px; -moz-box-shadow: #666 0px 2px 3px; box-shadow: #666 0px 2px 3px; behavior: url(/PIE.htc); background: white; } li.active .content...
Using the dialog command you can launch ASCII-art dialogs from your shell scripts. Check out man dialog for a list of supported dialog types. Aside from simple text boxes...
...or choice dialogs, it supports more advanced interactions like file pickers or progress bars. Example: Yes/no choice dialog --yesno "Erase the world?" 0 0 Example: Menu with multiple options
You may know the double asterisk operator from Ruby snippets like Dir['spec/**/*_spec.rb'] where it expands to an arbitrary number of directories. However, it is disabled by default on...
...most systems. Here is how to enable it. If you check your globstar shell option, it is probably disabled: $ shopt globstar globstar off In that case, ** behaves just like * and...
There are 3 built-in file descriptors: stdin, stdout and stderr (std=standard). (You can define your own, see the linked article.) Basic 0/1/2 references stdin/stdout/stderr >/2> redirects stdout/stderr, where...
&1/&2 references stdout/stderr &> redirects stdout and stderr = everything (caution: see below) Caution: &> is functional as of Bash 4. This seems to result in a slightly...
Browsers make this very hard. Even when you explicitely set the selection inside the textarea (e. g. using jquery-fieldselection) the browser will not scroll the textarea to this selection...
...What you can do instead is abuse browsers' behavior that they scroll to the end of a textarea when it gets focus. So we set the textarea's value to...
On 32bit systems, the maximum representable Time is 2038-01-19 03:14:07 in UTC or 2038-01-19 04:14:07 in CET. If you try to instantiate...
...that has a DATETIME value which Time cannot represent. Note that there are some subtle differences between the APIs of Time and DateTime. Also DateTime is implemented in Ruby, while...
...This not only disables the memoization, but will also return wrong results! The best solution is to use the Memoizer gem instead...
You know that Devise offers RSpec test helpers for controller specs. However, in request specs, they will not work. Here is a solution for request specs, adapted from the Devise...
...wiki. We will simply use Warden's test helpers -- you probably already load them for your Cucumber tests. First, we define sign_in and sign_out methods. These will behave...
Cucumber_rails' old-school web-steps have been deprecated for a while, urging developers to write high-level step definitions that directly use Capybara or Webrat. We think that's...
...a bit drastic. More high-level steps are good, but ticking the odd check box with a general step is not always bad. So we took the old web steps...
...and :ignore_if => lambda {...
...}. These options should be helpful in ensuring every notifications means something actionable (instead of a long log of failures that just scrolls by).
...default. Ideally, cool URLs never change and always respond with a helpful redirect or similar. Ignore Errors like this: # config/initializers/exception_notification.rb ExceptionNotification.configure do |config| # ... config.ignored_exceptions += %w[OneException AnotherError] end
...mess around with arcane incantations inside xorg.conf, you can use the graphical arandr tool: sudo apt-get install arandr arandr If all your monitors are stacked in the same space...
...the space is not wide enough and you can't really move them, you need to switch to a proprietary driver. If it works with the open source driver for...
...upload the certificate to AWS IAM I get this error: $ aws iam upload-server-certificate --server-certificate-name www.example.com-2013010-2014010 --certificate-body www.example.com.crt --private-key www.example.com.key --certificate-chain www.example.com.ca...
That's because of the format of the key file (www.example.com.key). If it starts with -----BEGIN PRIVATE KEY----- you have to convert it to rsa: mv www.example.com.key www.example.com.key_norsa...