If you are using VNC to run Selenium tests, it may be hard to see what's going on since by default there is no list of open windows and...

...Alt+Tab won't work. Solving that is easy: Install a panel of your choice (like lxpanel) which offers task switching: sudo apt-get install lxpanel (You can't use...

Angular's location provider stalls links to the current URL, i.e. window.location. As soon as the $location service is activated in an Angular app, it will intercept links. The click...

...your interaction with the browser history (i.e. you're just using Angular as JS sugar on your page), Angular will create the above issue as soon as you use anything...

If you use Amazon AWS cloud services you definitively want to utilize software raid for IO intensive stuff such as database data directories and the like. Here's how you...

Create some EBS volumes within management console or sudo mdadm --create -f /dev/md0 --chunk=256 --level 10 --raid-devices 4 /dev/sdf /dev/sdg /dev/sdh /dev/sdi Create a fs on...

If some of your JavaScripts fail on Internet Explorer, but only in staging or production environments, chances are that JavaScript compression is the culprit. By default, Rails 3.2 compresses JavaScript...

...with UglifyJS. I have seen a few cases where this actually breaks functioning JavaScript on IE (one example is the CKEditor). I fixed this by switching to Yahoo's YUI...

Capybara has a global option (Capybara.ignore_hidden_elements) that determines whether Capybara sees or ignores hidden elements. Prefer not to change this global option, and use the :visible...

...and web-applications with real browsers. Capybara has a driver for Selenium that wraps around selenium-webdriver which is a Ruby binding to remote control real browsers via Selenium's...

Sometimes you want/have to send specific http(s) requests. You can do that easy with curl or just write the request yourself. make a http request with nc nc example.com...

openssl s_client -connect example.com:443 GET / HTTP/1.1 Host: example.com # press enter You can specify more headers if you want: nc example.com 80 GET /foo.html HTTP/1.1 Host: example.com Accept-Encoding...

...exception: Expected foo_trait.rb to define FooTrait. That trait had nothing to do with BarTrait. Since it doesn't tell you what's wrong, you either remember where you were working...

makandra dev

Unless your git is configured to push only the current branch, you must supply the remote branch name or you will force-push all your branches! Anyone else who...

...has already pulled the changes will run into significant trouble. Only do this to instantly fix a mistake, or when you know exactly what you're doing...

...cookies is defined in the ActionController and should never be overwritten. Bad example class StaticPagesController < ApplicationController def imprint end def cookies redirect_to '/' end end If you create an action...

...called cookies, any call to the cookie storage will be broken and call the method. What's more, in this example calls to static_pages_controller#imprint might as well...

makandra dev

When you delete a file with rm it's still possible to recover the file or parts of it. Use shred to overwrite the content of a file and delete...

shred -u $file Be aware that this is not sufficient for flash memory, like SSDs or USB pen drives. The write will possibly target another memory area than...

css-tricks.com

The linked article shows what current browsers do when you click a link like this: 1-562-867-5309 Spoiler: The current state is sad It's still the case...

...that most desktop browsers can't do something useful with tel: links. They will usually open a dialog confirming that an external application will be opened. If the user confirms...

...reason keep others). Internet Explorer will possibly act like nothing is wrong -- but break (send the outer form) when you submit. If your application behaves normal at first but removes...

If Sunspot does not work and fails with a backtrace similar to this: /project/shared/bundle/ruby/1.8/gems/rsolr-1.0.6/lib/rsolr/client.rb:227:in `adapt_response' /project/shared/bundle/ruby/1.8/gems/rsolr-1.0.6/lib/rsolr/client.rb:164:in `execute' /project/shared/bundle/ruby/1.8/gems/rsolr-1.0.6/lib/rsolr/client.rb:158:in `send_and_receive'

then the schema.xml that is shipped with Sunspot is not loaded into Solr correctly. Often the latter can be found in /etc/solr/conf/schema.xml. So copy Sunspot's schema.xml there...

makandra dev

If you want to use the (badly implemented!) solarized color scheme in your Rubymine IDE: Clone the IntelliJ IDEA port: git clone https://github.com/jkaving/intellij-colors-solarized.git Import the settings in Rubymine...

...by chosing the above directory File -> Import Settings Change the color scheme in the settings (Ctrl-Alt-S) in Editor -> Colors & Fonts Note that selecting a color scheme will also...

makandra dev
serverfault.com

...can create a huge amount of data. This can be both: too much data size on HDD and tiring to analyze. You can run a script in a screen which...

...checks out the packages transfered per second and start a tcpdump when the packages exceed a fixed number. #!/usr/bin/env bash interface=eth0 dumpdir=/tmp/ packet_threshold=5000

makandra dev
github.com

SitePrism gives you a simple, clean and semantic DSL for describing your site using the Page Object Model pattern, for use with Capybara in automated acceptance testing. The Page Object...

...Model is a test automation pattern that aims to create an abstraction of your site's user interface that can be used in tests. The most common way to do...

...virtual machines for different Internet Explorer versions. The images are available for various virtualization solutions, including VirtualBox. BrowserStack For a monthly fee browserstack.com provides access to various versions of Windows...

makandra dev
thoughtbot.com

The linked article compares two approaches for writing CSS: A component library (like BEM) Utility classes (like Tailwind)

bbs.archlinux.org

xterm by default uses black text on white background. To change that to something like "light gray on black", do a vim ~/.Xresources ...and put this in there: xterm*background...

xterm*foreground: lightgray Afterwards, feed these changes to your current X session: xrdb ~/.Xresources Any subsequent xterm will be colored white on black background. Hint: While you're at...

makandra dev
github.com

Improve geordi cucumber: Only attempt @solo run when the specified files contain the @solo tag, skip @solo run if any filename is passed with a line number (e.g. features/example.feature...

Improve geordi deploy: Find stages by their prefix (e.g. s -> staging, m -> makandra), bundle if needed, check the selected stage exists Improve geordi server: Takes port as argument (e.g. geordi...

makandra dev

The very useful andand gem does not play very nice with Ruby's SimpleDelegator (or vice versa). This following will not work: class MyDecorator < SimpleDelegator def foo end end MyDecorator.new...

...Object.new).andand.foo The reasons are a bit subtle, basically SimpleDelegator will "force" some methods to be delegated, so the andand method is called on the wrapped object, not the delegator...

...back panel and a headset connected to the front panel. I used to play sound over both outputs, but this suddenly stopped working this week. Apparently, (perhaps through some update...

...jack sensing" got turned on, which disables the back panel as soon as you connect something to your front panel audio jack. To disable this feature, I used alsamixer (use...

yoyo.io

...easy to retrieve variants of a given icon. The format is: fa-[name]-[alt]-[shape]-[o]-[direction] Note that this is a naming convention which doesn't imply there's...

...combination of tags. name The name of the icon, e.g. comment, print, bookmark etc. See the full list. alt An alternative icon. shape The icon inside a circle or square...

Consider you have a file that uses improper encoding on special characters. Example: You see the latin1 version "ñ" for the UTF-8 "ñ" but the file itself is stored...

...Now you tell vim that the file's encoding is actually latin1 (you can see what Vim is currently using by saying only :set fileencoding): :set fileencoding=latin1