...Linux and MacOS, they look horrible on Windows, a problem that gets worse with smaller font sizes. The culprit is something called font hinting: ... hinting is about... programming instructions that...

...hinting, causing horrible rendering for most fonts. Embedding autohinting information into font files A solution is to autohint fonts and replace the existing (bad) hinting with the autohinting information.

You may want this for things where Rationals are being used, like when subtracting Date objects from one another. What's happening? Converting a Rational to a String usually...

...does something like this: 1.8.7 > Rational(2, 3).to_s => "2/3" 1.9.3 > Rational(2, 3).to_s => "2/3" 2.0.0 > Rational(2, 3).to_s => "2/3" However, when you have a...

...Content-Type on GET request (which have a blank body), an external API may still force you to send one. Angular's $http service will strip that header when the...

...is blank. [1] This is possibly a misconception of RFC2616. Here is how to send GET requests with a Content-Type header in Angular. Example Consider this request: $http({ method...

blog.intercom.io

A fantastic guide for a dilemma facing any web-based product. Here’s a simple set of Yes/No questions that you can quickly answer before you add another item to...

...your product roadmap. Saying yes to a feature request – whether it’s a to an existing customer, a product enquiry, a teammate, or a manager – is immediately rewarding. It’s...

Soon after having written our shell-for script, we wanted to easily get dumps of our productions machines, too. This is how we do it: dump-for staging [-s]

...dump to your project's tmp directory and name it according to the capistrano stage you're calling for, here: staging.dump. When you pass the optional -s option, the dump...

blogs.msdn.com

What are Google’s plans for turning WebM into a genuinely open standard, one that is based on consensus like the rest of W3C’s HTML5 effort? Would Google fully...

...support such an effort? Even the WebM project’s domain is controlled by Google. Google chose to release WebM under the Creative Commons license which would theoretically allow a standards...

makandra dev

...Railses. Consul now uses Memoizer for this. Temporarily change the current power When you set Power.current to a power in an RSpec example, you must remember to nilify it afterwards...

...Otherwise other examples will see your global changes. A better way is to use the .with_power method to change the current power for the duration of a block:

clipboardjs.com

We used zeroclipboard.js in some of our projects but now we switched to clipboard.js because it does not rely on flash. Flash support of the major browsers has ended.

...more advantages of clipboard.js: it consists only of a single javascript file, so it does not trigger additional requests with rails it automagically provides user feedback by selecting the text...

To read the Rails session from a Rack middleware, use env['rack.session']. It's an ActionDispatch::Request::Session object. class MyMiddlware def initialize(app) @app = app end def call(env...

...status, headers, body = @app.call(env) session = env['rack.session'] Rails.logger.info("Value of session['foo'] is: " + session['foo'].inspect) [status, headers, body] end end You may not be able to write to...

github.com

...Request, visit /__better_errors on your app's root path (e.g. http://localhost:3000/__better_errors). It shows the error page for the last exception that occurred, even when it has been triggered...

hackernoon.com

...extremely popular amongst front-end developers the last couple of years. This isn’t surprising, as it has made it a lot easier for us to create dynamic layouts and...

jqueryui.com

UI sortable helps reordering items with drag 'n drop. It works quite fine. Proven configuration for sorting table rows When invoking the plugin, you may pass several options. This set...

...causing the thead border-bottom to grow // when the first table row is dragged tr.ui-sortable-helper:first-child + tr > td border-top: none

Our old solution for cronjobs, the "craken" plugin, is no longer maintained and does not work on Rails 3.2+. We will instead use the whenever gem. "Whenever" works just like...

...craken", by putting your rake tasks into the server's cron table. Everything seems to work just like we need it. Installation for new projects Add "whenever" to your Gemfile...

Deadlocks only occur if two transactions in separate threads compete for the same rows in the database. They usually (but not necessarily) only happen when trying to update or otherwise...

...lock several rows in different order. Solving deadlocks is potentially complicated, so here are a few pointers: MySQL should always detect the deadlock right when it happens, and will throw...

...inherited methods but call the parent's implementation, too. In JavaScript, there is no simple "super" method like in Ruby -- so here is how to do it with Backbone.

...own initialize method, and you'd get this console output: Hello World. How to super But we want initialize of BaseClass to run as well -- and if you want to...

makandra dev
developer.chrome.com

In the DevTools settings, there's a "Shortcuts" section. Found these keyboard shortcuts there: General ESC Toggle drawer CTRL + ~ or CTRL + ` Show console in drawer Styles SHIFT + up/down

...debugging page repaint times) CTRL + hover above element in the DOM list Don't show the yellow dimensions tooltip (useful when the tooltip covers just the area you need to...

WProofreader is a spelling and grammar checking tool that integrates with textareas and numerous WYSIWYG editors. While it usually activates automatically, depending on your application, it may fail to boot...

...do that ourselves, so we disable it autoDestroy: true, lang: 'de_DE', serviceId: '...', // ... } Ensure https://svc.webspellchecker.net/spellcheck31/wscbundle/wscbundle.js is loaded as described in the docs. To activate WProofreader, you can now...

When dealing with external data sources, you may have to deal with improperly encoded strings. While you should prefer deciding on a single encoding with the data-providing party, you...

...can not always force that on external sources. It gets worse when you receive data with encoding declaration that does not reliably fit the accompanying string bytes.

Expiration of Rails sessions By default Rails sessions expire when the user closes her browser window. To change this edit your config/initializers/session_store.rb like this: ActionController::Base.session = { :key => '...', :secret => '...' :expire_after...

} In older Railses the initializer is not available. Set the option in the environment.rb instead: config.action_controller.session = { :key => '...', :secret => '...' :expire_after => 10.years } Expiration of Rails cookies In addition to the...

Current webkit browsers like Chrome and Safari have a special variable in their consoles that refers to the selected DOM node in the elements panel. This lets us easily inspect...

...Angular scopes. Right click in the page and click "Inspect" to open the Dev Tools Select the element you're interested in from the elements panel Focus the console (in...

...the kind of query). It may help to understand youtube's domain model before starting. It's best to just try out your requests in the browser to see what...

...key in order to make this request work): https://www.googleapis.com/youtube/v3/playlistItems?playlistId= &key= A&part=snippet&fields=nextPageToken,items(snippet(publishedAt,resourceId(videoId))) There are more examples and explanations in the...

makandra dev
blog.getbootstrap.com

Moved from Less to Sass. Bootstrap now compiles faster than ever thanks to Libsass, and we join an increasingly large community of Sass developers. Improved grid system...

...added a new grid tier to better target mobile devices and completely overhauled our semantic mixins. Opt-in flexbox support is here. The future is now—switch a boolean variable...

...wanted bundle update some_gem What is wrong Let's say your Gemfile asks for some-gem which you can see when running gem list but bundle show some-gem...

...just gives you an error: Could not find gem 'some-gem', in any of the sources Another indicator: Doing a bundle install --local breaks and bundle install installs every gem...

...you need to do it yourself. It's not that hard: Get more disk space Add an extra virtual hard disk to the machine with the disk size you want...

...the CD, open a terminal (on the guest, not the host!) and become root: sudo su fdisk -l to see the disk information. \ There should be one drive with some...