Skip to content

Instantly share code, notes, and snippets.

View Comediant24's full-sized avatar
:shipit:

Iurii Bairamukov Comediant24

:shipit:
View GitHub Profile
@Comediant24
Comediant24 / what-forces-layout.md
Created June 6, 2024 11:32 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
app.modules.rubricTags = ((self = {}) => {
const SHOW_MORE_BUTTON_WIDTH = 57;
const DISTANCE_BETWEEN_TAGS = 6;
function _getLastRowWidth(_tagsContainer, _tagsContainerPosition, _lastRowTags) {
const tags = _tagsContainer.querySelectorAll('.js-rubric-tags__item');
let lastRowWidth = 0;
tags.forEach((item) => {
const itemPosition = item.getBoundingClientRect();
if (itemPosition.bottom === _tagsContainerPosition.bottom) {
"Create module": {
"prefix": "abakmodules",
"body": [
"app.modules.$1 = (function (self) {",
" function _doSomething() {",
" }",
"",
" function _init() {",
" }",
"",
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "regions" does not exist
LINE 5: WHERE a.attrelid = '"regions"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"regions"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
// Модуль для забеления переполняющего контейнер текста
app.modules.whitenOverflowedText = ((self = {}) => {
const whitenTextInContainer = (container) => {
const text = container.querySelector('.js-overflowed-text');
if (!text) {
return;
}
if (text.clientHeight < container.clientHeight) {
@Comediant24
Comediant24 / dip rake elasticsearch:product_reviews:index
Created May 4, 2023 05:31
dip rake elasticsearch:product_reviews:index
WARNING: Found orphan containers (blizkodevelopment_blizko-imgproxy_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Starting blizkodevelopment_blizko-elasticsearch_1 ... done
Creating blizkodevelopment_blizko-app_run ... done
Type image/x-icon is already registered as a variant of image/icon.
unknown OID 3615: failed to recognize type of 'query_value'. It will be treated as String.
Progress: |============================================ 100 =============================================|Time: 00:00:00rake aborted!
Faraday::ConnectionFailed: getaddrinfo: Name or service not known (blizko-elasticsearch:9200)
/bundle/2.4/gems/httpclient-2.7.2/lib/httpclient/session.rb:597:in `initialize'
/bundle/2.4/gems/httpclient-2.7.2/lib/httpclient/session.rb:597:in `new'
/bundle/2.4/gems/httpclient-2.7.2/lib/httpclient/session.rb:597:in `create_socket'
apress-companies-storefront (1.10.1) lib/apress/companies/storefront/managers/product_groups.rb:33:in `block in groups_to_storefront'
apress-companies-storefront (1.10.1) lib/apress/companies/storefront/managers/product_groups.rb:33:in `select'
apress-companies-storefront (1.10.1) lib/apress/companies/storefront/managers/product_groups.rb:33:in `groups_to_storefront'
apress-companies-storefront (1.10.1controllers) apress/companies/storefront/extensions/company_base_controller.rb:84:in `storefront_date'
apress-companies-storefront (1.10.1controllers) apress/companies/storefront/extensions/company_base_controller.rb:58:in `company_storefront'
apress-companies-storefront (1.10.1controllers) apress/companies/storefront/extensions/company_base_controller.rb:26:in `company_storefront_etag'
apress-companies-storefront (1.10.1controllers) apress/companies/storefront/extensions/company_base_controller.rb:17:in `http_default_etag_params_with_storefront'
vendor/gems/core_hints/lib/core_hints/company_base_controller_exte
@Comediant24
Comediant24 / settings.json
Created August 13, 2021 07:07 — forked from thomasvanholder/settings.json
Config for emmets in ERB files
"emmet.includeLanguages": {
"erb": "html"
},
"emmet.showAbbreviationSuggestions": true,
"emmet.showSuggestionsAsSnippets": true