-
На iOS устройствах числовые значения подчёркиваются синим. Эта проблема возникает из-за того, что iOS устройства по умолчанию считают все числа похожие на телефонные номера - телефонными номерами. Решается добавлением
<meta name="format-detection" content="telephone=no" />Тоже самое касается адреса:<meta name="format-detection" content="address=no" /> -
Пользователь может уменьшать и увеличивать приложение. Решается добавляением тега
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> -
Ссылки нажимаются с задержкой (примерно 300ms). Решается подпиской на событие touchstart и принудительной инициализацией события click после него. Если проблема всё равно возникает - ничего не поделать, надо облегчать dom. Как вариант - можно использовать библиотеку, посоветанную @adubovsky ниже в комментариях: https://gist.github.com/SerafimArts/de9900f99
| // By observing changes to an object with Object.observe, | |
| // and turning on Async Call Stacks in Chrome Dev Tools, | |
| // you can find the source of those changes. | |
| var myObject = { | |
| foo: 'bar' | |
| }; | |
| Object.observe(myObject, function(changes) { | |
| // This asynchronous callback runs when myObject is changed |
There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.
All other files should be in your own global gitignore file:
- Create a file called
.gitignorein your home directory and add any filepath patterns you want to ignore. - Tell git where your global gitignore file is.
Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute
.config/git/ignorefor.gitignorein your home directory, if you prefer.
| # Based on https://github.com/sass/libsass/wiki/Building-with-autotools | |
| # Install dependencies | |
| apt-get install automake libtool | |
| # Fetch sources | |
| git clone https://github.com/sass/libsass.git | |
| git clone https://github.com/sass/sassc.git libsass/sassc | |
| # Create configure script |
| 'use strict'; | |
| module.exports = function CustomError(message, extra) { | |
| Error.captureStackTrace(this, this.constructor); | |
| this.name = this.constructor.name; | |
| this.message = message; | |
| this.extra = extra; | |
| }; | |
| require('util').inherits(module.exports, Error); |
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.
elem.offsetLeft,elem.offsetTop,elem.offsetWidth,elem.offsetHeight,elem.offsetParent
| // SVG2PNG | |
| // By Cees Timmerman, 2024-04-05. | |
| // Paste into console and adjust indices as needed. | |
| let im = document.getElementsByTagName('img') | |
| let fname = location.href | |
| if (im.length < 1) { | |
| let svg = document.getElementsByTagName('svg')[0] | |
| let bb = svg.getBBox() | |
| im = new Image(bb.width, bb.height) | |
| im.src = 'data:image/svg+xml;charset=utf-8;base64,' + btoa(document.getElementsByTagName('svg')[0].outerHTML) |
| import fetch from 'isomorphic-fetch' | |
| const setupRequestOptions = (options = {}, overrideMethod) => { | |
| if (overrideMethod) options.method = overrideMethod | |
| if (!options.headers) options.headers = {} | |
| options.credentials = 'same-origin' | |
| return options | |
| } | |
| const setupJsonRequestOptions = (options, overrideMethod) => { |
| const Soup = imports.gi.Soup; | |
| const Json = imports.gi.Json; | |
| function assert(assertion) { | |
| if (!assertion) { | |
| throw "Error"; | |
| } | |
| } | |
| /* Get the data using a HTTP GET */ |