Skip to content

Instantly share code, notes, and snippets.

View AlexMold's full-sized avatar
🎯
Focusing

Alex Gribcov AlexMold

🎯
Focusing
View GitHub Profile
@Swiss-Mac-User
Swiss-Mac-User / a_Docker setup.md
Last active May 13, 2024 05:51
Installing SonarQube on Docker and SonarScanner using Homebrew on macOS

Docker setup

Install the Docker UI application for macOS

brew install docker --cask

Open the Docker.app

from /Applications/Docker.app

Go to the Docker Dashboard

Wait until the "Docker Dashboard starting…"-message disappears (= Setup complete)

@victor-homyakov
victor-homyakov / measure-page-scroll-speed.js
Created April 20, 2020 10:26
Measure page scroll speed
// Measure page scroll speed
(function() {
if (document.body.scrollHeight <= window.innerHeight) {
console.log('Scrolling measurement is only possible if the window can actually be scrolled!');
return;
}
function calcScrollTime(startTime, iterations) {
return Math.round((Date.now() - startTime) / iterations) / 1000;
}
@victor-homyakov
victor-homyakov / detectResizedImagesRu.js
Created April 17, 2020 17:24
Проверка на масштабирование изображений в браузере
/* eslint-disable no-var,no-console */
/**
* Проверка на масштабирование изображений в браузере.
* Срабатывает, если натуральный размер изображения намного больше отображаемого на странице,
* то есть браузер грузит большую картинку и масштабирует её до маленькой.
*/
(function() {
if (!window.Promise || !String.prototype.startsWith || window.MSInputMethodContext) {
// Не запускаем проверку в IE11 и браузерах, не поддерживающих нужные API
return;
@victor-homyakov
victor-homyakov / detect-unused-css-selectors.js
Last active February 17, 2023 18:36
Detect unused CSS selectors. Show possible CSS duplicates. Monitor realtime CSS usage.
/* eslint-disable no-var,no-console */
// detect unused CSS selectors
(function() {
var parsedRules = parseCssRules();
console.log('Parsed CSS rules:', parsedRules);
detectDuplicateSelectors(parsedRules);
var selectorsToTrack = getSelectorsToTrack(parsedRules);
window.selectorStats = { unused: [], added: [], removed: [] };
console.log('Tracking style usage (inspect window.selectorStats for details)...');
@non
non / answer.md
Last active January 9, 2024 22:06
answer @nuttycom

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.