Skip to content

Instantly share code, notes, and snippets.

✌️
Let's make this World a better place!

Slava Fomin II slavafomin

✌️
Let's make this World a better place!
Block or report user

Report or block slavafomin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@slavafomin
slavafomin / core-js-polyfills-by-browsers.json
Created Oct 24, 2019
List of core-js polyfills by browsers and versions with bundle filesize
View core-js-polyfills-by-browsers.json
This file has been truncated, but you can view the full file.
[
{
"name": "ie",
"title": "IE",
"versions": {
"6": {
"polyfills": [
"es.symbol",
"es.symbol.description",
@slavafomin
slavafomin / corejs-polyfill-size-sorted.txt
Last active Oct 23, 2019
core-js polyfills individual filesizes
View corejs-polyfill-size-sorted.txt
┌────────────────────────────────────────┬──────────┐
│ Polyfill │ Size, KB │
├────────────────────────────────────────┼──────────┤
│ web.url │ 31.61 │
├────────────────────────────────────────┼──────────┤
│ es.typed-array.uint8-clamped-array │ 22.02 │
├────────────────────────────────────────┼──────────┤
│ es.typed-array.float32-array │ 22.02 │
├────────────────────────────────────────┼──────────┤
│ es.typed-array.float64-array │ 22.02 │
@slavafomin
slavafomin / buildspec.yml
Created Oct 20, 2019
Installing s3cmd in AWS CodeBuild instance using yum (Amazon Linux 2)
View buildspec.yml
version: 0.2
phases:
install:
commands:
# Installing "s3cmd" deployment utility
- >-
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm &&
yum update -y &&
@slavafomin
slavafomin / gtm-unminified.js
Last active Sep 10, 2019
Google Tag Manager script unminified
View gtm-unminified.js
window['dataLayer'] = window['dataLayer'] || [];
window['dataLayer'].push({
'gtm.start': new Date().getTime(),
event: 'gtm.js'
});
const firstScriptElement = document.getElementsByTagName('script')[0];
const scriptElement = document.createElement('script')
View 2-sass-parent-selector-prefixes.sass
.dc-button {
// common styles
@at-root a#{&} {
// styles for <a> element
}
@at-root button#{&} {
// styles for <button> element
View 1-sass-parent-selector-prefixes.sass
// NOT WORKING! //
.dc-button {
// common styles
a& {
// styles for <a> element
}
View 0-sass-parent-selector-prefixes.css
.dc-button {
/* common styles */
}
a.dc-button {
/* styles for <a> element */
}
button.dc-button {
/* styles for <button> element */
@slavafomin
slavafomin / nginx.conf
Created Jan 22, 2019
How to enable CORS in nginx with origin matching
View nginx.conf
server {
listen 80 default_server;
root /var/www;
location / {
set $cors '';
set $cors_allowed_methods 'OPTIONS, HEAD, GET';
if ($http_origin ~ '^https?://(www\.)?example.com$') {
set $cors 'origin_matched';
View redirect.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cache Test Redirect</title>
</head>
<body>
@slavafomin
slavafomin / jest-api.ts
Last active Aug 12, 2019
How to run Jest programmatically in node.js (Jest JavaScript API)
View jest-api.ts
import {runCLI} from 'jest-cli';
import ProjectConfig = jest.ProjectConfig;
const projectRootPath = '/path/to/project/root';
// Add any Jest configuration options here
const jestConfig: ProjectConfig = {
roots: ['./dist/tests'],
testRegex: '\\.spec\\.js$'
You can’t perform that action at this time.