The link contains a simple shell script to push a cleanup policy for gitlab repositories in a group. Please mind that this will overwrite the configuration for all the repositories...
...with the given settings...
...to load fast it's recommended to optimize images. Ideally an image's file size should be as small as possible while still being of decent quality. This card demonstrates...
...tools for image optimization Use identify to fetch information about pictures. convert can change size/quality and strip meta information. Both commands are supplied by ImageMagick. $ identify in.jpg in.jpg JPEG 294x440...
When your Solr seems to be started properly (a process is running with the correct data directory) but never responds properly and replies (via the API or web interface) with...
... check if Solr's log directory is actually writable for the user running it...
Dealing with exceptions in a Rails application is (surprisingly) complex. There are multiple configurations and methods that influence how exceptions are actually handled. This card explains some of the interactions...
...is raised in your app you want the following things to be true: Your server should not crash (your Ruby process should continue to run) Your user should receive an...
...chat messages, and it will load them into its context for analysis. Note For scanned pages that may be sideways or upside down, auto-rotate them first. Autocrop assumes upright...
...px so text remains readable. To convert PDF pages to scaled down images: pdftoppm -png -scale-to 1500 input.pdf output_prefix Convert images to thumbnails: vipsthumbnail input.png --size 1500x1500 -o...
...example, the configuration for SASS files looks like this: { test: /\.(scss|sass)$/i, use: [ { loader: 'style-loader', options: {...
{ loader: 'css-loader', options: {...
{ loader: 'postcss-loader', options: {...
{ loader: 'sass-loader', options...
...loaders (which are usually npm modules) are run on it in reverse order. First, the sass-loader converts SASS to regular CSS. Then, the postcss-loader uses PostCSS to postprocess...
...method for controllers. The most common way is to pass an ActiveRecord instance or scope, and fresh_when will set fitting E-Tag and Last-Modified headers for you. For...
...scopes, an extra query is sent to the database. fresh_when @users If you do not want that magic to happen, e.g. because your scope is expensive to resolve, you...
...this matter, as the image rendering depends on multiple factors. At least the operation system, browser or image viewer software and monitor influence the resulting image colors on your screen...
...possibility to upload images, they will most likely contain tons of EXIF metadata and sometimes exotic color profiles like eciRGB. We want to get rid of the metadata, as it...
...be confused with truemail.io) allows validating email addresses, e.g. when users enter them into a sign-up form. It runs inside your application and does not depend on an external...
...set config.not_rfc_mx_lookup_flow = true. Validation methods explained Regex validation (1) is pretty straight-forward and basically "free" since you're not making and network connections. SMTP validation...
...looking for a functionality in RubyMine but don't know or remember its keyboard shortcut or which menu it is located in?\ Hit Ctrl+Shift+A. This will bring up...
...the result from the list to run it. The list of results will also show you any assigned keyboard shortcuts...
...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...
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.
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...
...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...
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...
MySQL will use the index when your query is well-formed: mysql> EXPLAIN SELECT * FROM users WHERE email = 'foo@example.com'; +----+-------------+-------+-------+----------------------+----------------------+---------+-------+------+-------+ | id | select_type | table | type | possible_keys | key | key_len...
...ref | rows | Extra | +----+-------------+-------+-------+----------------------+----------------------+---------+-------+------+-------+ | 1 | SIMPLE | users | const | index_users_on_email | index_users_on_email | 768 | const | 1 | | +----+-------------+-------+-------+----------------------+----------------------+---------+-------+------+-------+ However, indexes are not used if you are passing incorrect data types...
...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
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...
...items along one line and wraps, Grid controls both axes together, which makes page skeletons, card galleries and forms with aligned labels far simpler and removes many wrapper elements. As...
...a rule of thumb: Flexbox for one-dimensional flows, Grid for two-dimensional structures. Important Work on this lesson in teacher mode. Learning goals You can explain the difference between...
...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...
yield(Nokogiri::XML(node.outer_xml).root) end end end end This will simply yield regular Nokogiri nodes...