uri = URI.parse(path) if allow_fuzzy_expiry expires_at = expires_at.end_of_hour + 1 end timestamp = expires_at.localtime.strftime('%Y%m%d%H%M%S') # this is similar to an hmac...

stackoverflow.com

...Explicit conversion Explicit conversion happens when requesting it, e.g. with the splat operator: args = [1,2,3] some_method(*args) # Ruby calls args.to_a here Implicit conversion Implicit conversion happens...

manpages.ubuntu.com

...run-this-one is exactly like run-one, except that it will use pgrep(1) and kill(1) to find and kill any running processes owned by the user

makandra dev

...log --oneline | fzf --prompt 'Select the first commit you want to move' | awk '{print $1}') branch=$(git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ | fzf --prompt 'Select the...

...branch to rebase onto' | awk '{print $1}') test_command="git rebase -i --onto $branch $commit~" read -p "Execute command '$test_command' (Y/n)? " choice case "$choice" in n|N ) echo "aborted...

...provides strong results at a lower cost. However, due to its significantly higher cost—$186.5 compared to $18.16 for o3-mini—o1 is best suited for highly analytical and complex...

...node-sass with esbuild. See here - you have to downgrade esbuild-sass-plugin to 1.x for that, because 2.x does not support node-sass anymore.). add libraries, that...

DevOps Curriculum

...gedacht. Du kannst das nicht alles lesen: Gesamter TCP/IP Guide Ziele Was ist RFC 1918, welche Bereiche sind es und wofür sind diese? Du weißt, wofür man NAT verwendet und...

...wie es funktioniert Du kannst diesen tcpdump-Output erklären: 13:33:37.560666 ARP, Request who-has 10.0.1.42 tell 10.0.1.56, length 28 13:33:37.561108 ARP, Reply 10.0.1.42 is-at...

:file => "CarrierWave::Storage::File", :fog => "CarrierWave::Storage::Fog" } config.storage = :file config.cache_storage = nil # (1) config.fog_attributes = {} config.fog_credentials = {} config.fog_public = true config.fog_authenticated_url_expiration = 600 config.fog_use_ssl...

makandra dev

...functionality with a lot of code: https://github.com/jquery/jquery/blob/master/src/event.js Overhead of adding and removing 1000 event listeners Method duration Element#addEventListener() 11.3 ms native code $.fn.on() 60.3 ms

...of userland code up.on() 15.9 ms ~ 130 lines of userland code Overhead of adding 200 elements to an Array vs. adding to a jQuery collection Method duration Array.prototype.push()

makandra Curriculum

# passes expect(movie1).to have_same_attributes_as(movie3) # Fails with 'Expected movie #112 to have same attributes as movie #113, but the attributes #title and #year differed'

...the setup's scope. describe Klass do describe '#foo' do it 'does basic thing 1' do # isolated test without shared setup here end it 'does basic thing 2' do # isolated...

...with HTTP code 422 Unprocessable Entity instead of the default 200 OK. This is (1) to be a good HTTP citizen and (2) to allow frontend code like detect a...

...a dependency of cucumber-rails), which will break all your tests. The fix Bundler >= 1.14 has a --conservative flag. Using the conservative flag allows bundle update GEM to update the...

The options below might be relevant if you're stuck with Bundler < 1.14: Option 1 This will work if all dependencies for the update are already satisfied.

...xargs grep -cE "^inotify" | column -t -s: You will get a list like: /proc/3753/fdinfo/7 1 /proc/3774/fdinfo/7 1 /proc/4034/fdinfo/12 14 /proc/4839/fdinfo/11 7 /proc/4871/fdinfo/12 98 /proc/50565/fdinfo/10 3 /proc/50565/fdinfo/14 266 /proc/50565/fdinfo/25 186 /proc/50620/fdinfo/19...

/proc/5192/fdinfo/3 47697 /proc/5225/fdinfo/63 4 /proc/5274/fdinfo/23 3 /proc/6121/fdinfo/7 38 (...) The number between /proc/ and /fdinfo/ is the PID of the process and the last number is the number of inotify...

Cookies without an expiration timestamp are called "session cookies". [1] They should only be kept until the end of the browsing session. However, when Chrome or Firefox are configured to...

...for quite a while now and it seems they won't change their mind. [1] We are not talking about the the Rails session cookie here, though it often is...

makandra dev
gist.github.com

...blocks or methods n times. If you accidentally stepped, you can return with finish 1. next [n] -- Runs n lines of code within the same frame Stacktrace frame [n] -- Moves...

developer.mozilla.org

...seems to be Baseline for all browsers since 2022). const fadeIn = [{ opacity: 0 }, { opacity: 1 }] // this is a keyframe example const container = document.querySelector('.animate-me') const animation = container.animate(fadeIn...

makandra Curriculum

...in our library) Everyday Rails Testing with RSpec (in our library) Concentrate on chapters: 1 (Introduction), 2 (Setting up RSpec) 3 (Model specs) 4 (DRY enough specs) 6 (Feature Specs...

...SSLCertificateNotVerified errors, or when using plain Net::HTTP: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed Here is how to...

...certificate can not be verified. >> RestClient.get('https://self-signed.badssl.com/') RestClient::SSLCertificateNotVerified: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed Self-signed certificates are...

makandra dev
github.com

...Rails App with a core model (class FatModel) that has many (30) attributes and 100k records (totaling 500MB of data) in the corresponding PostgreSQL table An API endpoint /fat_models/index.json renders...

...to be very slow Measurements (N=20) showed that it takes an average of 10 seconds to render The log output already suggests an optimizable SQL query, view rendering time...

...certificate for localhost, you can use the following command. openssl req \ -x509 \ -nodes \ -days 10000 \ -newkey rsa:2048 \ -keyout development.key \ -out development.crt \ -subj "/CN=localhost" This generates a development.crt certificate...

...file and development.key key file. Note that the certificate will be valid for 10000 days, just because we don't want to do this again in a month or a...

...skip the rest. Also skip deployment to Heroku and upload to AWS S3 everywhere. 1 From zero to deploy Introduction 1.1 Up and running 1.2 The first application

7.3 Unsuccessful signups 7.4 Successful signups 7.6 Conclusion 8 Basic login All chapters 13 User microposts All chapters except 13.4.4 Image upload in production For each chapter:

...new style 'Delete %{count} users?' -- When using VIM you can use this command: :%s/{{\([^\}]*\)}}/%{\1}/cg Fix deprecation warnings with :overwrite_params Run tests Deploy See the commit log for...

...Fixes several serious vulnerabilities. Step-by-step upgrade instructions: Upgrade json gem to atleast 1.7.7, 1.6.8, or 1.5.5 Upgrade rails gem Change your environment.rb so it says RAILS_GEM_VERSION...

...your database, you might run into an error like pg_restore: error: unsupported version (1.15) in file header This is because your local pg_restore version is too old to...

...doesn't matter here. For example, the official Ubuntu 20.04 sources include only PostgreSQL 12, so your pg_restore version will also be v12. Ubuntu 22.04 includes version 14 in...

...Experts Group JFIF format) Class: DirectClass Geometry: 5472x3648+0+0 Resolution: 350x350 Print size: 15.6343x10.4229 Units: PixelsPerInch Type: TrueColor Endianess: Undefined Colorspace: sRGB Depth: 8-bit Channel depth:

blue: 8-bit Channel statistics: Red: min: 0 (0) max: 255 (1) mean: 110.006 (0.431397) standard deviation: 56.3503 (0.220982) kurtosis: -0.715336 skewness: 0.213533 Green: