...increase your build times significantly, but produce the smallest output: Terser (3 pass) Terser (1 pass) esbuild application.js 163.6 kB 163.7 kB 181.6 kB application.js (gzipped) 54.7 kB
...console with other request like from ActionCable. Then just set the max threads to 1 and the other requests have to wait. WORKER_TIMEOUT=1000 puma -t 0:1 -w...
...1 -p...
Has no options to sort the loaded files in any way. RSpec 1 Runs .rb files in alphabetical order by default. This is a good default because it...
...t: the current time in 24-hour HH:MM:SS format, \T: same, but 12-hour format, @: same, but in 12-hour am/pm format \n: newline \r: carriage return
...x: attribute of the text 3y: foreground color 4y: background color x: 0: normal 1: bold 4: underline 7: reverse y is the color: 0 black 1 red
...matched until Capybara 2 which used to "squish" text prior to the comparison. # Capyabara 1 or 2 page.find('.haystack', text: "Hi! Try to match me.") => #<Capybara::Node::Element tag="div...
Option 1: Creating a self-signed certificate with the openssl binary As igalic commented on this gist. openssl req -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout server.key...
...than it is to explain why your application does not need secure cookies. Option 1: ActionDispatch::SSL middleware You can use the ActionDispatch::SSL middleware to automatically set the secure...
``` def foo "hello!" end ``` def foo "hello!" end Lists * Bullet list item 1 * Bullet list item 2 Bullet list item 1 Bullet list item 2
...use + or - instead of *. 1. Numbered list item 2. Numbered list item 42. You don't need to number properly Numbered list item Numbered list item You don't need...
subject { 'foo' } it_behaves_like 'string equaling another string', 'foo' end RSpec 1 Use it_should_act_like from our spec_candy.rb (note the /behave/act/). It allows you to...
...super, initialize might be hit with this error: ArgumentError: Wrong number of arguments (given 1, expected 0) Further readings https://github.com/makandra/active_type#activetypeobject
...feeds, carriage returns, etc. There's a TC39 proposal that's stuck in Stage 1. While there is a /m modifier in Javascript, it only changes the meaning of ^ and...
...a selector. For example: .container .foo %span.my-selector .bar %div.my-selector .container > *:nth-child(1 of .my-selector) color: red Here, you specifically target the first element with the .my...
...grab the nth element of a certain type/tag. Browser Support https://caniuse.com/mdn-css_selectors_nth-last-child_of_syntax Chrome/Edge 111+ Firefox 113+ Safari 9+ Finding the last child matching a selector There is :nth-last...
...def method_missing(method, *args, &block) if method.to_s =~ /play_(\w+)/ puts "Here's #{$1}" else super end end def respond_to?(method, *) method.to_s =~ /play_(\w+)/ || super end
...monitoring route which returns a json looking like this: { "sidekiq": { "totals": { "failed": 343938, "processed": 117649167 }, "recent_history": { "failed": { "2016-11-06": 1...
} }, "queue_sizes": { "dead": 0, "retries": 0, "monitoring": 0, "low_priority": 0, "mails": 0, "default": 0, "elasticsearch": 0, "high_priority": 0, "file_upload": 0, "scheduled": 0 }, "active_workers": 0 },
...Fetching strscan-3.0.3.gem Building native extensions. This could take a while... Successfully installed strscan-3.0.3 1 gem installed gem list strscan *** LOCAL GEMS *** strscan (3.0.3, default: 3.0.1) Therefore is may happen...
...local database, transfer it to a server and import it in the server database. 1. export def dump_to_file(list) content = Base64.encode64(Marshal.dump(list.to_a)) file_path = File.expand_path...
...links to work on Gnome/Linux. Here is how it finally worked for me: Step 1: Add a Desktop launcher Add this file to ~/.local/share/applications/rubymine.desktop: [Desktop Entry] Version=1.0 Type=Application...
...to affect the whole container text, not separate children. For example, .container %p Text 1 %p Text 2 %p Text 3 with .container display: -webkit-box would be shown as...
...look for another clockpicker or overwrite the styles by using bootstrap variables. Upgrade Phase 1 First you should include the new version into your project and replace the old imports...
...say you have a database schema where an Employee belongs_to :department: +-----------------+ | Employee | +------------+ |-----------------| n 1 | Department | | email |-------------------|------------+ | department_id | | name | +-----------------+ +------------+ Because of performance reason you decide to cache the department...
...s name into a new column Employee#department_name: +-----------------+ | Employee | +------------+ |-----------------| n 1 | Department | | email |-------------------|------------+ | department_id | | name | | department_name | +------------+ +-----------------+ You add the column like this: ALTER TABLE employees ADD COLUMN...
...with "INFO" in green: tail -f /path/to/log | sed --unbuffered -e 's/\(.*INFO.*\)/\o033[32m\1\o033[39m/' -e 's/\(.*FATAL.*\)/\o033[31m\1\o033[39m/' Here are the most common...
...by setting the left and right margins to auto, for example: // SASS $container_width: 100px .container width: $container_width margin: 0 auto However, this won’t work on an absolutely...
...positioned element. But there is a solution: // SASS $container_width: 100px .container width: $container_width position: absolute left: 50% margin-left: floor($container_width...
...row.insertBefore imageTemplate # Prepare the template to be cloned for the next image increaseTemplateIndices: -> # E.g. ("[1]", "1") -> "[2]" increase = (match, $1) -> match.replace $1, parseInt($1) + 1 imageTemplate.find('input').each -> $input = $(this...
# @return: The progress bar element addProgressBar: (element) -> progressBar = $(' ').addClass('image--progress').css 'width', '100%' progressBar.appendTo element.find('.image') # This progress bar *shrinks* from full width to the right updateProgressBar: (event...
User.singleton_class.ancestors # => [# , B::ClassMethods, A, # , # , Class, Module, Object, Kernel, BasicObject] User.singleton_class.class # => Class User.singleton_class.ancestors[1].class # => Module Note that # is the singleton class and as we have seen the parent...