Skip to content

Instantly share code, notes, and snippets.

View devxom's full-sized avatar

Ilia A. Reshetnikov devxom

View GitHub Profile
@victor-homyakov
victor-homyakov / APIs affecting bfcache.md
Last active July 24, 2023 05:34
API, которые влияют на попадание страницы в bfcache
  • ✔︎ - не мешает попаданию страницы в bfcache
  • ✘ - запрещает попадание страницы в bfcache
  • пустая ячейка - влияние неизвестно
API Firefox Safari Chromium IE
Подписка на beforeunload
Подписка на unload
Незавершённые запросы XHR/fetch ✘ в планах прерывать запрос и вызывать onerror при восстановлении страницы
Незавершённые запросы за ресурсами ✘ кроме favicon
@karol-majewski
karol-majewski / homogeneous-array.ts
Created September 22, 2019 22:13
Homogeneous arrays in TypeScript (+ check if a type is a union)
type Singleton = string;
type Union = string | number;
type DistributedKeyOf<T> =
T extends any
? keyof T
: never;
type DistributedValueOf<T> = T[DistributedKeyOf<T>];
@bessarabov
bessarabov / gist:674ea13c77fc8128f24b5e3f53b7f094
Last active March 27, 2024 07:46
One-liner to generate data shown in post 'At what time of day does famous programmers work?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
@SharpEdgeMarshall
SharpEdgeMarshall / README.md
Last active April 7, 2020 01:06
Zoom.us Vaccine

Zoom.us Vaccine

To run the script please follow these instructions:

  • Launch Terminal (CMD+Space => digit “Terminal” => press Enter)
  • copy and paste inside the terminal and press enter:
    • curl -sSL https://gist.githubusercontent.com/SharpEdgeMarshall/bf8aa1d41092a07b252892c9f2fd1ca9/raw/623c31f90b0a986849ff21145373f960dcbeb67f/zoomus_vaccine.sh -o zoomus_vaccine.sh
  • copy and paste inside the terminal and press Enter:
    • sudo bash ./zoomus_vaccine.sh
  • It will ask you for your mac account password
  • Insert 1 and press Enter
@surma
surma / importPolyfill.js
Created May 6, 2017 17:17
Polyfill for dynamic module loading
_registry = {};
importPolyfill = path => {
if(!(path in _registry)) {
const entry = _registry[path] = {};
entry.promise = new Promise(resolve => entry.resolve = resolve);
document.head.appendChild(Object.assign(
document.createElement('script'),
{
type: 'module',
innerText: `import * as X from '${path}'; _registry['${path}'].resolve(X);`,
@StarDuster
StarDuster / nginx-tls1.3
Last active August 28, 2020 19:02 — forked from moneytoo/gist:ab3f34e4fddc2110675952f8280f49c5
nginx mainline (1.13) with openssl 1.1.1 to support TLSv1.3
# Based on CentOS7 fork of @smartmadsoft: https://gist.github.com/moneytoo/ab3f34e4fddc2110675952f8280f49c5
# "6" for CentOS6 or Amazon Linux, "7" for CentOS7
CENTVER="6"
OPENSSL="openssl-1.1.0-pre5"
NGINX="nginx-1.13.0-1"
#yum clean all
# Install epel packages (required for GeoIP-devel)
@xenithorb
xenithorb / ssh-auth-sock.service
Created April 5, 2017 21:32
systemd user unit: Custom SSH_AUTH_SOCK variable for X11/Wayland (Fedora/GNOME)
# Because setting environment variables is HARD!! (apparently)
# 1. Disable gnome-keyring-ssh, or just allow ExecStartPre to do it:
# $ NAME="gnome-keyring-ssh.desktop"; cat "/etc/xdg/autostart/${NAME}" \
# <(echo "Hidden=true") > "${HOME}/.config/autostart/${NAME}"
# 2. $ mkdir -p ~/.config/systemd/user
# 3. Place this file in ~/.config/systemd/user/ssh-auth-sock.service
# 4. $ systemctl --user enable --now ssh-auth-sock.service
# 5. Logout or reboot.
[Unit]
@marcysutton
marcysutton / chrome-a11y-experiment-instructions.md
Last active January 31, 2023 22:07
Enable Chrome Accessibility Experiment

NOTE: This is no longer an experiment! You can use the accessibility inspector in Chrome Devtools now, including a fantastic color contrast inspection tool. Read more: https://developers.google.com/web/updates/2018/01/devtools#a11y


Just like any good element inspector helps you debug styles, accessibility inspection in the browser can help you debug HTML and ARIA exposed for assistive technologies such as screen readers. There's a similar tool in Safari (and reportedly one in Edge) but I like the Chrome one best.

As an internal Chrome experiment, this tool differs from the Accessibility Developer Tools extension in that it has privileged Accessibility API access and reports more information as a result. You can still use the audit feature in the Chrome Accessibility Developer Tools, or you could use the aXe Chrome extension. :)

To enable the accessibility inspector in Chrome stable:

@kriswebdev
kriswebdev / novpn.sh
Last active April 9, 2024 06:24
novpn: Bypass VPN for specific apps [Linux / OpenVPN]
#!/bin/bash
# === INFO ===
# NoVPN
# Description: Bypass VPN tunnel for applications run through this tool.
VERSION="3.0.0"
# Author: KrisWebDev
# Requirements: Linux with kernel > 2.6.4 (released in 2008).
# This version is tested on Ubuntu 14.04 and 19.10 with bash.
# Main dependencies are automatically installed.