...rendering and DB query durations Good for spotting problematic endpoints The "Recent requests" screen (1 hour history) Shows individual requests Provides the full list of DB queries per request, color...

linux.die.net

...commits into patch files. Those can be used to apply to a different repository [1] or by someone else (e.g. sent when sent to them via e-mail).

...the patch file created earlier. More information git format-patch git apply git am [1] Note that you can add other git repositories/directories as a remote source. Sometimes you don...

...from hogging too many resources: In inactive tabs, timeouts and intervals are throttled to 1+ seconds After a longer period of inactivity, some browsers will completely unload your tab, stopping...

developer.mozilla.org

...of my favorites: console.log takes many arguments E.g. console.log("Current string:", string, "Current number:", 12) Your output can have hyperlinks to Javascript objects E.g. console.log("Check out the current %o...

...of objects) to console.table(). Example: console.table(["apples", "oranges", "bananas"]) prints: (index) Values 0 "apples" 1 "oranges" 2 "bananas" Grouping output in nested, collapsible sections Great for debugging deeply nested or...

...Both requests scan the users table and see that the name is available Worker #1 passes validation and sucessfully creates a user with the available name Worker #2 passes validation...

manufacturer, serial_number = product.match(PRODUCT_PATTERN)&.captures # or manufacturer = product[PRODUCT_PATTERN, 1] serial_number = product[PRODUCT_PATTERN, 2] Example with named groups (<2.4) PRODUCT_PATTERN = /\A(? .+) S...

...remove) certain lines through navigating in the changes and select the current line with 1 Split a chunk with...

makandra Operations

...member list | awk -F ', ' -v member="$member" '{ if ( member == $3 ){ system("etcdctl member remove " $1); system("etcdctl member add " $3 " --peer-urls=" $4); } }' On the faulty node again

makandra dev

You should look for rows with State: LISTEN. Rows for local address 127.0.0.1 or ::1 (IPv6) can only be reached from your own PC: Netid State Recv-Q...

...Send-Q Local Address:Port Peer Address:Port Process tcp LISTEN 0 1024 127.0.0.1:3000 0.0.0.0:* users:(("ruby",pid=33985,fd=18)) Rows for local address 0.0.0.0 can be reached...

...a lot of unnecessary email notifications. Often times we tend to use > /dev/null 2>&1 to just suppress all the output. This will hide errors though, and hinder debugging.

#!/bin/bash echo "all good until now" echo "everything is broken" >> /dev/stderr exit 1 $ chronic ./good.sh $ echo $? 0 $ chronic ./bad.sh all good until now everything is broken $ echo $?

...you may encounter this error: Copying required WAL segments. EXCEPTION: {'ret': 2, 'err': '/bin/sh: 1: cannot open /var/lib/barman/foopostgres/wals/00000007.history: No such file\n', 'out': ''} The reason is that the barman backups...

...def full_filename 'thumbnail.jpg' end process(take_frame: [at: 0.seconds]) process(resize_to_limit: [1280, 720]) end def take_frame(at:) raise TakeFrameError, "Input file does not exist, capturing a...

...File.exist?(current_path) run_ffmpeg! '-ss', ffmpeg_target_second(at), '-i', current_path, '-vframes', '1', '-qscale:v', '2', current_path raise TakeFrameError, "Something went wrong while capturing a frame for...

makandra dev

...tagname.. for "everything after that tag" Example output for spreewald: 60 Tobias Kraze 12 Henning Koch 7 Dominik Schöler 6 Thomas Eisenbarth 5 Martin Straub 3 Minh Hemmer...

1 Manuel Kallenbach 1 Andreas Robecke Alternatives There is a powerful CLI tool called git who...

...expansion to either set a default or check mandatory arguments Mandatory parameter hello() { NAME=${1:?provide name as first parameter} echo "Hello $NAME!" } $ hello # $?=1 bash: 1: provide name as...

...first parameter $ hello Foo # $?=1 Hello Foo! Parameter with default hello() { NAME=${1:-Marvin} echo "Hello $NAME!" } $ hello # $?=0 Hello Marvin! $ hello Foo # $?=1

...that is shared between all classes of your application: ActiveRecord::Base.class_eval do @@counter = 1 end When encountering such code, Ruby will warn you: warning: class variable access from toplevel...

...Usage: linearcommits FOO-123456 # Alternative usage: linearcommits https://linear.app/some-workspace/issue/FOO-123456 function linearcommits { if test "$1" then local LINEAR_ID=$(echo "$1" | grep "[^/]*$" -o) # Extract linear ID from URLs

...linearcommits ABC-165086636 --stat: commit 048054b1df87576f7c59cc0161cc331c44d2ea6b Author: Foo Bar <foo@bar.com> Date: Fri Apr 5 14:24:24 2019 +0200 [ABC-165086636] Linear issue Title app/assets/javascripts/test.js | 22 ++++++++++++++++++++++ app/models/test.rb | 30 ++++++++++++++++++++++++++++++

Example Compound selectors like ... .datepicker .prev, .datepicker .next, .datepicker .switch padding-bottom: 1rem ul li, ol li list-style-type: none can be simplified by using the :is...

...pseudo selector ... .datepicker :is(.prev, .next, .switch) padding-bottom: 1rem :is(ul, ol) li list-style-type: none Hint The specificity of :is() is equals to its most specific argument...

atlassian.com

...before="2014-7-4" You can use references like "2 years 1 day 3 minutes ago" and "yesterday": git log --after="yesterday...

...when constructing an array ['foo', *nil] # => ['foo'] Remove blank values from collections Array array = [1, "", nil, 2, " ", [], {}, false, true] # Any Rails version array.reject(&:blank?) # => [1, 2, true]

...array.compact_blank # => [1, 2, true] Hash hash = { a: 1, b: "", c: nil, d: 2, e: " ", f: [], g: {}, h: false, i: true } # Any Rails version hash.reject { |key, value| value.blank? }

Hardcoded solution (preferred solution when using Rails with ActiveJob/Sidekiq or Cronjobs) Dynamic solution 1. Hardcoded solution When you are sending mails from outside the request cycle, e.g. ActiveJob/Sidekiq or...

...return this.firstName + " " + this.lastName; }, set fullName(name) { var parts = name.split(" "); this.firstName = parts[0]; this.lastName = parts[1]; } }; The code below shows how this object can be used. Notice the absence of parentheses...

...return this.firstName + " " + this.lastName; }, set: function(name) { var parts = name.split(" "); this.firstName = parts[0]; this.lastName = parts[1]; } }); Browser compatibility Works with IE9+ and real browsers. CoffeeScript CoffeeScript doesn't support getter/setter functions...

[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" find-up() { path=$(pwd) while [[ "$path" != "" && ! -e "$path/$1" ]]; do path=${path%/*} done echo "$path" } automatic-nvm-use() { NVM_PATH=$(find-up .nvmrc | tr...

OpenAI is currently limiting the Audio generating API endpoint to text bodies with a maximum of 4096 characters.

...the error message is too meaningless to be helpful. Example: Running with gitlab-runner 16.7.0 (102c81ba) on , system ID: Resolving secrets 00:00 Preparing the "shell" executor 00:00

00:01 Running on ... Getting source from Git repository 00:00 bash: line 157: /bin/mkdir: Argument list too long Cleaning up project directory and file based variables...