...line goes from baseline up to the capital top. That's because text usually starts with a capital letter, plus descenders are far less frequent than ascenders.

...center an icon (or any "blockish" inline element, really) with the capital letters of surrounding text. This works well with our modern approach to SVG icons, or e.g. for custom...

You can use gem list to list all gems available from a remote gem server: gem list -r --clear-sources -s 'https://user:password@gemserver.tld/' This is useful to debug cases...

...where Bundler complains of a gem existing in more than one gem source...

Jasmine specs for the frontend often need some DOM elements to work with. Because creating them is such a common task, we should have an efficient way to do it...

...Let's say I need this HTML structure: item 1 item 2 This card compares various approaches to fabricating DOM elements for testing. Constructing individual elements While you can use...

Since Rails 5, domain models inherit from ApplicationRecord by default. This is the place to put code that should be available in all your application's models.

gedd.ski

...intrinsic width of your content play together. The attached article explains the differences. In summary: If a flex-basis is set, that is used as the basis

...basis is set, the width is used as the basis If neither flex-basis nor width is set, the content's computed width is used as the basis

By default parallel_tests will spawn as many test processes as you have CPUs. If you have issues with flaky tests, reducing the number of parallel processes may help.

...Flaky test suites can and should be fixed. This card is only relevant if you need to run a flaky test suite that you cannot fix for some reason. If...

RSpec supports a one-liner syntax for setting an expectation on the subject: describe Array do describe "when first created" do it { should be_empty } end end The example description...

...it should be empty" will be defined automatically. With RSpec 3's expect-based syntax you use it_is_expected instead: describe Array do describe "when first created" do

...errors.add_to_base('failed') if bad_things? end end ^ # app/models/foo.rb require 'user' class Foo # something happens here end Now, when your environment is booted, Rails will automatically load your models...

...our example, when Foo gets loaded, it will require the User class itself again. Since Ruby 1.8 identifies required files by the string you used (as you alread know), this...

The bin/webpack-dev-server command is not as smart as e.g. rails server, where it shows the proper fix within the error message. $ bin/webpack-dev-server yarn run v1.19.1 error Command "webpack-dev-server...

This is a presentation from 2019-01-21. Summary We want to move away from jQuery in future projects Motivations are performance, bundle size and general trends for the web...

...can polyfill the missing pieces Unpoly 0.60.0 works with or without jQuery Is jQuery slow? From: Sven To: unpoly@googlegroups.com Subject: performance on smartphones and tablets Hello I just used your...

...like the rest of your Bootstrap 4 application. Rome comes with very little basic styling. While we could redefine its classes, we can configure the classes Rome applies to its...

...This is because Rome also uses styles internally as selectors which breaks internal behavior for space-separated strings or when using the same CSS class for multiple properties (e.g. text...

When working with feature branches, stale branches pile up over time. It's best to remove them right after merge, locally and on the remote, but it is a little...

...above). Paste this: #!/bin/bash exec < /dev/tty # Get the current branch name branch_name=$(git branch --show-current) # Get the name of the branch that was just merged reflog_message=$(git...

makandra dev
gist.github.com

...cases beyond that to make your life easier. For this cheatsheat I tried to structure the most useful commands by different use cases, such that a practical oriented overview of...

...some commands I added some tips for their usage and further details on their subcommands For most of the commands shortly explained here, there are some examples along with a...

By default, Rails views escape HTML in any strings you insert. If you want to insert HTML verbatim, you need to call #html_safe. However, #html_safe does not "unescape...

...a string. It merely marks a string as safe for unescaped insertion. How html_safe works Calling html_safe on a String returns a new object that looks and acts...

Consider the following: describe '#something' do context 'with lots of required arguments' do it 'should work' do subject.something(:foo => 'foo', :bar => 'bar', :baz => 'baz').should == 'Hello world' end it 'should...

...is actually called. This way you can manipulate objects or other data before using the short-hand reference to your method call. Yes, it is quite similar to using variables...

TL;DR When using Cache-Control on a Rails application, make sure the Vary: Accept header is set. Proxy caching is a good feature to serve your publicly visible application...

...server SHOULD include a Vary header field with any cacheable response that is subject to server-driven negotiation. Doing so allows a cache to properly interpret future requests on that...

...alpha channel value, you can use Gimp: Use the color picker tool Hold the Shift key while clicking the pixel A window will appear, containing color information, including the alpha...

Note: Modern Rails has two build pipelines, the asset pipeline (or "Sprockets") and Webpacker. The principles below apply for both, but the examples shown are for Sprockets.

...your application uses many assets, such as images, javascripts and stylesheets. Without your intervention, the browser will request these assets again and again on every request. There is no magic...

If you want to make your Rails application be capable of sending SMTP emails, check out the action mailer configuration section in the Ruby on Rails guide.

...will end up having an smtp_settings hash that looks something like this: smtp_settings = { address: ..., domain: ..., port: ..., user_name: ..., password: ..., authentication: ..., tls: ..., enable_starttls_auto: ..., } This hash can be...

...external commands from within Ruby, but the most powerful ones are Open3.capture3 and Open3.popen3. Since those can do almost everything you would possibly need in a clean way, I prefer...

...to simply always use them. Behind the scenes, Open3 actually just uses Ruby's spawn command, but gives you a much better API. Open3.capture3 Basic usage is require 'open3'

makandra Operations

on the bash (issued as postgres user) Start/Stop/Restart PostgreSQL pg_ctl -D $configdir start|stop|restart Start/Stop/Restart the corresponding PostgreSQL using the given configuration directory. The configuration directory should contain...

...the postgresql.conf file. The following example would start the PostgreSQL of our governor instances: pg_ctl -D /var/lib/postgresql/config start PostgreSQL fast shutdown pg_ctl -D $configdir stop -m fast

DevOps Curriculum

...diesen verschiedenen Verbindungsversuchen erklären: nc makandra.de 22 nc ccc.de 22 nc app02-stage.makandra.makandra.de 22 Du kannst Sequence-Numbers erklären Du kennst die Unterschiede zwischen UDP und TCP und kannst Beispiele nennen...

...makandra.de aufbauen und die Datei robots.txt abrufen (Siehe https://richj.co/talking-http-1.1/) Du weisst, was dieser Server-Header bedeutet: Strict-Transport-Security: max-age=31536000 IPv6 Wie werden MAC Adressen bei...

askubuntu.com

Luckily, this is simple. Just install three packages: sudo apt install ipheth-utils libimobiledevice-dev libimobiledevice-utils Then turn on the "Personal Hotspot" in iPhone settings, connect it to your...

paulgraham.com

...programmers dislike meetings so much is that they're on a different type of schedule from other people. Meetings cost them more...