Skip to content

Instantly share code, notes, and snippets.

View Valexr's full-sized avatar
:octocat:
coding...

Alexander Volkov Valexr

:octocat:
coding...
View GitHub Profile
@Valexr
Valexr / pages.yml
Created July 11, 2022 14:37 — forked from AndrewLester/pages.yml
Github Actions Workflow Deploy SvelteKit Github Pages
name: Build and Deploy to Pages
on:
push:
branches: ['main']
jobs:
build:
runs-on: ubuntu-latest
@Valexr
Valexr / global-gitignore.md
Created May 21, 2022 06:09 — forked from subfuzion/global-gitignore.md
Global gitignore

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 .gitignore in 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/ignore for .gitignore in your home directory, if you prefer.

@Valexr
Valexr / nginx_nodejs.md
Created March 26, 2022 13:00 — forked from tomasevich/nginx_nodejs.md
Сервер в связке Nginx + NodeJs

Сервер в связке Nginx + NodeJs

Данная пошаговая инструкция поможет освоить основы на простом примере

Для справки

Сервер поднимался на Debian 8 c характеристиками:

CPU - 1 ядро x 500 МГц

@Valexr
Valexr / chromium_update.sh
Created February 27, 2022 06:16 — forked from Superbil/chromium_update.sh
auto update chromium on osx
#!/bin/bash
# Chromium update script
# - by shad <shad@zaphod.eu>
# - by superbil <help@superbil.info>
OS=mac
SITE=http://build.chromium.org/buildbot/snapshots/chromium-rel-
LATEST=$(wget -q -O - ${SITE}${OS}/LATEST)
INSTALL_DIR=/Applications
TARGET=Chromium
@Valexr
Valexr / what-forces-layout.md
Created February 23, 2022 14:57 — 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
@Valexr
Valexr / easing.js
Created December 25, 2021 16:18 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: t => t,
// accelerating from zero velocity
easeInQuad: t => t*t,
// decelerating to zero velocity
@Valexr
Valexr / groupBy.js
Created December 15, 2021 17:08 — forked from robmathers/groupBy.js
A more readable and annotated version of the Javascript groupBy from Ceasar Bautista (https://stackoverflow.com/a/34890276/1376063)
var groupBy = function(data, key) { // `data` is an array of objects, `key` is the key (or property accessor) to group by
// reduce runs this anonymous function on each element of `data` (the `item` parameter,
// returning the `storage` parameter at the end
return data.reduce(function(storage, item) {
// get the first instance of the key by which we're grouping
var group = item[key];
// set `storage` for this instance of group to the outer scope (if not empty) or initialize it
storage[group] = storage[group] || [];
@Valexr
Valexr / store.ts
Created December 10, 2021 13:00 — forked from alexgloom/store.ts
import { session } from '$app/stores';
import type { Writable } from 'svelte/store';
import { derived } from 'svelte/store';
interface User {
id: number;
login: string;
name: string;
}

Import CustomElements from .html files

This is the technical implementation of the idea and concept described in my article “Why don’t we use HTML to author web components?

Instead of using template literals, constructors and other specifics to define CustomElements, this is a proposal to just use standard HTML to define CustomElements.

The goal is to import CustomElements like this:

@Valexr
Valexr / How_Require_Extensions_Work.md
Created October 17, 2021 18:31 — forked from jamestalmage/How_Require_Extensions_Work.md
Breakdown of How Require Extensions Work

Why

Doing require extensions correctly is essential, because:

  1. Users should be able to install multiple extensions in succession, and have them work together.
  2. Coverage tools like nyc need it to reliably supply coverage information that takes into account sourcemaps from upstream transforms.
  3. Because non-standard, un-predictable behavior causes hard to solve bugs, and major headaches for project maintainers.

What is a require extension anyways?