unpoly.com

Quick guide for frequently used compiler selector patterns of Unpoly. 1. BEM Component Pattern When: Reusable UI components with multiple child elements Examples: toggleable.js, collapsible.js, searchable_select.js up.compiler('.toggleable', (toggleable) => {

makandra dev

...on hover, the following SASS is used (shorthand syntax): .element color: red transition: color .1s &:hover color: green This tells the browser "whenever the color of an .element changes, let...

...it take 1/10th of a second" and next "whenever an .element is hovered, make its text green". Multiple animated properties are comma-separated: .element color: red opacity: .9 transition: color...

...effect that you can not configure Psych#dump to only write safe data. Pitfall 1: Psych::DisallowedClass Psych#safe_load only whitelists the following classes: TrueClass, FalseClass, NilClass, Numeric, String...

...optimize the result. time = Time.now data = {foo: time, bar: time}.to_yaml => => "---\n:foo: &1 2019-11-08 11:28:34.834180510 +01:00\n:bar: *1\n" ::YAML.safe_load(data...

...running) since Wed 2022-11-23 09:25:09 CET; 7min ago Main PID: 18344 (openssl) Tasks: 1 (limit: 4915) CGroup: /system.slice/run-benchmark.service └─18344 /usr/bin/openssl speed # Get the logs $ sudo journalctl...

...u run-benchmark.service -- Logs begin at Mon 2022-03-07 13:45:18 CET, end at Wed 2022-11-23 09:31:33 CET. -- Nov 23 09:25:09 server systemd...

...Ansible for DevOps. Du findest es in der makandra Bibliothek Relevant sind die Kapitel 1-8. Bitte erstelle keinen DigitalOcean Account für Kapitel 8. Lies das Kapitel einfach durch und...

...remove IP entry ssh-keygen -f "$HOME/.ssh/known_hosts" -R $(getent hosts appserver.makandra.de | cut -d ' ' -f 1) # Connect and accept new fingerprint ssh appserver.makandra.de The authenticity of host 'appserver.makandra.de (213.179.144.92)' can't...

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...

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...

...Ruby 2.7 introduced a method for this exact purpose: filter_map. So instead of >> [1, 2, 3, 4, 5, 6].map { |i| i * 2 if i.even? }.compact

>> [1, 2, 3, 4, 5, 6].select(&:even?).map { |i| i * 2 } => [4, 8, 12] you can just do >> [1, 2, 3, 4, 5, 6].filter_map { |i| i...

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...

github.com

...not a Slack admin Find a Slack workspace admin and have them do steps 1-5 for you. You need to tell them your channel name and send a link...

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...

...use permit (or expect) to receive Strong Parameters, but strip extra parameters. # Better (option 1) redirect_to users_path(params.slice(:query, :encoding).permit(:query, :encoding)) # Better (option 2)

...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...

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...

...allowing you to keep your integration tests as DRY as your application code. Option 1: Call other step definitions This is Cucumbers default way of sharing short setup steps or...

...rd|th) (role|showtime) fields?\z/ ".nested-fields .nested-fields--form:nth-of-type(#{$1})" end end end World(HtmlSelectorsHelpers) nth-of-type matches by counting the actual HTML-tag...

Scenario: Example scenario Given ... When I fill in "Character" with "Kaiser" within the 1st role fields And I select "Moon" from "Movie" within the 1st role fields

...async function helperFunction() { console.log("second") await backgroundTask() console.log("third") } // Stub function that resolves after 100 milliseconds, could be an API call function backgroundTask() { return new Promise((resolve) => setTimeout(resolve, 100...

...should wait for the remaining milliseconds until the next second starts. For example, at 13:23 and 441 milliseconds, atFullSecond(1) should wait for 559 milliseconds before triggering the callback...

...logs the error ActionController::UnpermittedParameters in development + test and do nothing in production. Option 1: In case you use action_on_unpermitted_parameters = :raise for all environments, you might notice...

...card contains some advice that has helped me to use icon fonts more comfortably. 1 Map the font's icon names into your application domain You don't want to...

...repeat a 100 times that the icon for a "post" is actually icon-comment-alt, or that cancel buttons should be decorated with icon-remove because the shape fits so...