Take a look at the following material: World's shortest UI/UX design course Every UI/UX Concept Explained In Under 10 Minutes Easiest Way to Pick UI Colors
...Rules for Creating Gorgeous UI (Part 2) Visual design rules you can safely follow every time Bootstrapping Design (in our library) Steve Schoger's Refactoring UI book (in our library...
In SQL, NULL represents an "unknown" value. Because of this, it does not behave like a standard piece of data when used in comparison operators. If you don't account...
If you attempt to update or filter these users using a standard toggle, you might run the following queries: SELECT * FROM users WHERE name = 'Alice';
There is an option you can set so that when using the cd command, small typos are automatically corrected. Add the following to your ~/.bashrc: # cd: autocorrect small typos and...
shopt -s cdspell Example: cd Porjects # Projects pwd # /home/judith/Projects Also, I recommend adding aliases for your most common typos of commands you regularly use to your ~/bashrc...
...that matter) will not be affected by this. If you define them in your specs, they will exist globally. This is because of how RSpec works (short story: instance_eval...
# ... end let(:record) { TestRecord.new }
end # TestRecord will exist here, outside of the spec! Do not do this. It will bite you eventually. For example, when you try to...
...T06:22:17.484221 #2698200] INFO -- : [53a240c1-489e-4936-bbeb-d6f77284cf38] more Goal When searching through Rails logs on production, it's often hard to see all lines that belong to...
...the same requests, since output of different requests is often interwoven. Instead, we want to find all requests that match a pattern, and then print all lines that share the...
To make CSS rules dependent on the screen size, we use media queries: @media (max-width: 500px) { // rules for screen widths of 500px or smaller } Browsers will automatically enable and...
...disable the conditional rules as the screen width changes. To detect responsive breakpoints from JavaScript, you may use the global matchMedia() function. It is supported in all browsers:
I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method on Enumerable that combines the three: module Enumerable
group_by(&block) .transform_values(&:count) .sort_by(&:last) .to_h end end Just paste that snippet into a Rails console and use #count_by now! Usage examples...
If you are using our opscomplete.com hosting we can set all environment variables mentioned below for your deployment on request. If you're lucky DO_NOT_TRACK=1 opts...
...are collecting data only after you opt into that. ng analytics --global disable Storybook https://storybook.js.org/docs/configure/telemetry npm run storybook -- --disable-telemetry npm run storybook -- --disable-crash-reports export STORYBOOK...
Rails wraps your parameters into an interface called StrongParameters. In most cases, your form submits your data in a nested structure which goes hand in hand with the strong parameters...
...However, there are cases where this does not fit your use case, or has side effects. If you do it differently, be extra careful not to introduce security issues.
...for DOM elements, there are some footguns you should know about. Some lists are synchronized with the DOM Some DOM APIs return live lists that automagically update their contents as...
...reflects the change automatically: document.querySelector('#two').remove() console.log(liveList) // [#one] console.log(nonLiveList) // [#one, #two] Snapshotting a live list Lists that silently change their elements can be very surprising to work...
...forget that bad resolution: git rerere forget your_file.rb Afterwards, the badly resolved file will still be in your working directory. To get it back with confict markers, say:
...is defined incorrectly. Raise the attributes hash given to your :reject_if lambda to see if it looks like you expect. If you are nesting forms into nested forms, each...
...a new parent record together with a new child record and will need to save the parent before you can save the child. You can opt to only show the...
...the new way to do it, and it's great, especially in combination with Sprockets (or Propshaft on Rails 7). You might be missing some convenience features, though.
...cover one specific issue: Once you have started your development Rails server and esbuild with the --watch option (if you used jsbundling-rails to set up, you probably use bin/dev...
When you're using feature branches, they will stack up if you don't delete them after the merge to master. Here's how to tidy them up. Delete feature...
...Find already-merged branches by running # On branch master git branch --merged You may safely delete each of the listed branches, because they point to commits that are contained in...
...Plotting graphs in Ruby with Gruff, which comes handy for many uses cases, you sometimes might need configuration for more advanced plots, e.g. for academic concerns. Then using Gnuplot, the...
...first academic open source plotting software, might be a good option. There are several wrappers for Ruby available and I mainly looked at one of the two most frequently used...
Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine...
...gem like accept_language. Customizing Rails error messages for models and attributes Rails I18n scope for humanized attribute names HTML: Making browsers wrap long words Use the same translations for...
...I18n fallback locales Rails: Including HTML in your i18n locales Even for a single language, locales are useful Even if your application only supports a single language, it makes sense...
When a user shares your content, a snippet with title, image, link and description appears in her timeline. By default social networks will use the window title, the first image...
...the current URL and some random text snippet for this purpose. This is often not what you want. Luckily Facebook, Twitter, etc. lets you control how your content appears in...
...not be observable by non-jQuery code. This is currently a WONTFIX for jQuery (see closed issues #2476, #3347). Native events always work for everyone Note that if you trigger...
...listeners using jQuery's trigger(). Note that you might use third-party libraries like select2 that use trigger(). If your entire app is written in jQuery and you don't...
When ending a Selenium test Capybara resets the browser state by closing the tab, clearing cookies, localStorage, etc. It may be a good idea to wait for all in-flight...
...AJAX requests to finish before ending a scenario: You may have client-side JavaScript that freaks out when the tab closure kills their pending requests. If that JavaScript opens an...
A severe bug was found in ImageMagick by Bryan Gonzalez from Ocelot Team. It allows to embed the content of an arbitrary remote file when ImageMagick parses PNG files.
...on updated Packages for Ubuntu (https://ubuntu.com/security/CVE-2022-44268). Due to that we patched our systems as follows: Ubuntu 22.04: Get package source on a Ubuntu 22.04 system: apt-get source...
...enlightenment in order to learn Ruby. The goal is to learn the Ruby language, syntax, structure, and some common functions and libraries. We also teach you culture. Testing is not...
...just something we pay lip service to, but something we live. It is essential in your quest to learn and do great things in the language...
When you create a temporary file (e.g. to store a generated Excel sheet) and try to send it to the browser from a controller, it won't work by default...
...this controller action: class FoosController < ApplicationController def download file = Tempfile.new('foo') file.puts 'foo' file.close send_file file.path end end Accessing this controller action will usually raise a 404 not found...
...measurement metrics in Linux. These are the differences: Code Name Description vsz virtual memory size Total amount of memory a process may hypothetically access. Includes swapped memory, memory from external...
...libraries and allocated memory that’s not used. rss resident set size Total amount of non-swapped used physical memory. Includes memory from external shared libraries. pss proportional share size...