Skip to content

Instantly share code, notes, and snippets.

View a-x-'s full-sized avatar
🛩️

Alexander a-x-

🛩️
View GitHub Profile
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol,space-before-tab
quotepath = false # Чтобы не упячилась кириллица в путях
editor = mvim -v
excludesfile = ~/.gitignore
[merge]
tool = vscode
conflictstyle = diff3 # 3 side
// Place your settings in this file to overwrite the default settings
{
"editor.fontLigatures": true,
"editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace",
"editor.fontSize": 14,
"files.autoSave": "onFocusChange",
"editor.formatOnPaste": true,
"files.trimTrailingWhitespace": true,
"workbench.activityBar.visible": false,
"terminal.integrated.copyOnSelection": true,
@a-x-
a-x- / scroll-in-flex.md
Last active May 6, 2024 20:20
`overflow: scroll` in the `display: flex` 👿😳🤔🤯

Как поместить scroll-контейнер во flexbox и не облажаться.

overflow-flex-grid-hack

Столкнулись с проблемой: блок со скролом распепячивает flex. Давайте разбираться.

4 месяца назад показалось, что хак найден, о чём мы поспешили рассказать в твиттере, но потом стало ясно что таки поспешили.

Помотрели в спеку и mdn, но ключей к решению не нашли.

@a-x-
a-x- / building-css-modules-library.md
Last active March 1, 2018 15:08
Building css-modules library

🚫 Approach 1: converted plain css

pros:

  • much simple lib build

cons:

  • additional requirements to service build config (style-loader, css-loader for node_modules)
  • bug: every library's css file got style tag in a project 😨
  • bug: postcss-icss-selectors rule.parent is undefined — UPD fix
  • bug: css-modules-transform generateScopedName does not work — UPD fix
  • bug: generateScopedName does not apply to postcss optimized selectors — issue
@a-x-
a-x- / timer.js
Last active February 26, 2018 13:46
simple delayed timer with onExpire callback
const SEC = 1000
const MIN = SEC * 60
/** @param time, Δ ms */
function getMinSec(time) {
return {
sec: Math.floor((time % MIN) / SEC),
min: Math.floor(time / MIN)
}
}
@a-x-
a-x- / simple-triangle-question.md
Last active August 20, 2021 10:17
simple triangle question

triangle question

image

>> TsU = 40° and QS = QU and RS = RT
<< what the ∠RpQ ?

Solution

@a-x-
a-x- / immutable-set.js
Last active February 6, 2018 19:07
Immutable set like lodash.set but immutable with minimal updates
/**
* Immutable set like lodash.set but immutable with minimal updates
* @param {Object} o
* @param {String} path e.g. 'a.b.c'
* @param {*} val target value
*
* @example var o = {a: {b: 1}}, o_ = set(o, 'a.c', 2) // o_ ==== {a: {b: 1, c: 2}}; o is untouched
*
* @returns {Object}
*/
@a-x-
a-x- / shairport-sync.conf
Created January 27, 2018 17:35
/etc/shairport-sync.conf
// General Settings
general =
{
// log_verbosity = 0; // "0" means no debug verbosity, "3" is most verbose.
log_verbosity = 2;
// ignore_volume_control = "no"; // set this to "yes" if you want the volume to be at 100% no matter what the source's volume control is set to.
// volume_range_db = 60 ; // use this advanced setting to set the range, in dB, you want between the maximum volume and the minimum volume. Range is 30 to 150 dB. Leave it commented out to use mixer's native range.
volume_range_db = 35 ;
@a-x-
a-x- / parse-filter-delivery-club-dishes.js
Last active December 24, 2017 00:30
draft version script for delivery-club catalog parsing & filtering
// parse & filter dishes on https://www.delivery-club.ru/srv/:cafe/:category/
{
//
// runtime constiables
//
// e.g.
const path = window.location.pathname.match(/\/srv\/(\w+)\/(?:(\w+)\/)?/)
@a-x-
a-x- / redux-rx.md
Created November 19, 2017 16:00
redux, rx, playback progress and redux

Alex Mextner, [Sep 30, 2017 at 11:41:21 AM (9/30/17, 11:41:34 AM)]:

Появилась странная идея:

В сторе редакса в редких случаях хранить функции и начальные параметры вместо значений,
если зависимость от времени простая а изменений происходит очень много и даже если 60раз в секунду писать,
то будет скачками и потом будут проблемы с производительностью.

Лишь периодически будет совершаться коррекция начальных параметров.