...all the world to admire. For private gems this is very bad. To make sure this cannot happen, rubygems 2.2+ allows you to restrict eligible push hosts: Gem::Specification.new 'my...
...gem', '1.0' do |s| # ... s.metadata['allowed_push_host'] = 'https://gems.my-company.example' end In case you already messed up, follow these instructions to get your gem removed. Of course, it's not...
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.
...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.
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...
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...
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...
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...
You can hook into Slack when using Capistrano for deployment. The slackistrano gem does most of the heavy lifting for you. Its default messages are unobtrusive and can be adjusted...
When deploying, it posts to a Slack channel like this: How to integrate Integrating Slackistrano with Capistrano 3 is fairly simple. In your Slack, open menu → Administration → Manage apps...
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...
...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:
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...
...browser's HTTPS handling works as expected (which might be compromised e.g. due to security products or enterprise proxy servers...
track down warnings and to see failing specs immediately or to get an overview of the core functionalities, you can use RSpec's "nested" format. It looks...
Tool validations should require model to be set should require place_id to be set #identifier should include the model and tag if the tool has a tag...
...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...
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
...run our end-to-end tests with headless Chrome. While it's a very stable solution overall, we sometimes see the headless Chrome process freeze (or the Capybara driver losing...
...connection, we're not sure). The effect is that your test suite suddenly stops progressing without an error. You will eventually see an error after a long timeout but until...
There are several ways to merge two (or more) PDF files to a single file using the Linux command line. If you're looking for graphical tools to edit or...
...annotate a PDF, we have a separate card for that. PDFtk (recommended) PDFtk is a great toolkit for manipulating PDF documents. You may need to install it first (sudo apt...
...context) is run outside of transactions, so data created here will bleed into other specs before(:example) is run before each spec inside it, Generally, you'll want a clean...
...setup for each spec so that they are independent of other specs in the same context. Example Consider this spec: describe User, 'something' do before :context do @user = User.make
Ubuntu has a package mysql-sandbox that lets you install multiple MySQL versions into your user home: Install mysql-sandbox sudo apt install mysql-sandbox Download the version of MySQL...
...you want to use from mysql.com: https://dev.mysql.com/downloads/file/?id=480427 Make sure to choose "Generic Linux" instead of "Ubuntu" so you get a .tar.gz instead of .deb cd into the directory...
...take a long time, so we only want to compile when needed. This card shows what will cause Webpacker (the Rails/Webpack integration) to compile your assets. When you run a...
While development it is recommended to boot a webpack dev server using bin/webpack-dev-server. The dev server compiles once when booted. When you access your page on localhost before...
...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...
When using custom properties in your stylesheets, you may want to set a specific property value to an existing variable in your SASS environment. A pratical example would be a...
...existing quotes, you may use the meta.inspect() function: @use "sass:meta" $my-cool-font: "Roboto", sans-serif :root --font-family-sans-serif: #{meta.inspect($my-cool-font)} Unfortunately, the output of...