makandra dev

The usage shares of your site highly depends on your target audience. E.g. no Internet Explorer has ever seen hollyapp.com, but that's because of its tech-savvy audience. Distribution...

...will also differ by other factors, such as region. See this Wikipedia article for details. If you don't know your audience, you can use the stats of tracking tools...

When some of your Google contacts are no longer synchronized with your e-mail client or mobile phone, those contacts are not in a group "My Contacts". Google only syncs...

...contacts in that group. In order to fix this: Open Google Contacts Select all contacts (there's a link) Press "Move to My Contacts" Note that when you are using...

Note: The behaviour of Spreewald's within step is as described below for version < 1.9.0; For Spreewald >= 1.9.0 it is as described in Solution 1. When doing integration testing with...

...cucumber and selenium you will often encounter problems with timing - For example if your test runs faster than your application, html elements may not yet be visible when the test...

makandracards.com

Chances are you're seeing the warning repeated a lot of times, maybe thousands of times. Here's how to reproduce the issue: Example 1 # bad code (Time.current .. Time.current + 1.hour...

...include?(Time.current) # Use Range#cover? instead of Range#include? since the former does no typecasting into integers. (Time.current .. Time.current + 1.hour).cover?(Time.current) Example 2 # bad code Post.where(:created_at => min_date.beginning...

...toggle an outlining of HTML elements quickly. This helps greatly when you want to see the actual dimensions of elements, e.g. for floating elements inside containers, instead of opening up...

...shortcut (Shift+G for the 9.2-compatible layout or for the default layout with enabled "single-key shortcuts") and select "Outline" from the View → Style menu (needs to be done...

makandra dev
thoughtbot.com

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

...Add to ckeditor/config.js CKEDITOR.editorConfig = function(config) { config.contentsCss = [ '/assets/myCkeditorStyles.css', // any other file to encapsulate custom styles '/assets/myFontFaceTags.css' ]; } It's not enough to provide the font face tags within your public folder...

...call it within the ckeditor/config.js. You also might be interested in CKEditor asset pipline support...

makandra dev

Consider the following HTML & CSS: ^ img { background-color: red; } div { border: 1px solid black; } This will leave a margin of about 5px between the lower edge of the image and...

...the containing div, although there are no paddings or margins set, and there's no whitespace. The reason is, the image will vertically align baseline, and the space below the...

guides.rubyonrails.org

Starting from 4.1, Rails automatically detects the inverse of an association, based on heuristics. Unfortunately, it does not seem to notify you when it fails to infer the :inverse_of...

...so you are better off to always manually set :inverse_of anyway. Note that automatic inverse detection only works on has_many, has_one, belongs_to associations. Extra options on...

github.com

...version to be compatible with Rails 2 was 0.8.6: While there are 1.8/1.9 switches in the original code, one essential fix for Ruby 1.9's API change of Module.const...

...defined? was missing. [2] Changes for replica sets were reverted (since their tests were not passing) and some tests were fixed...

Mobile browser's ignore the autoplay attribute on and elements. Stupid reasons include saving mobile bandwidth on behalf of the user and/or securing app store sales. Audio and video elements...

...the result of a user interactions (click, touch). A workaround is to have a "start button" in your application that loads and plays an initial sound. You can now play...

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