Skip to content

Instantly share code, notes, and snippets.

View npofopr's full-sized avatar
🙃

Vladislav Altyncev npofopr

🙃
View GitHub Profile
@npofopr
npofopr / DNS prefetching preconnect
Last active February 22, 2024 17:04
Common Prefetch Links
<!-- DNS preconnect -->
<meta http-equiv="x-dns-prefetch-control" content="on">
<link rel="preconnect" href="//ajax.googleapis.com">
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous">
<link rel="dns-prefetch" href="https://use.fontawesome.com">
<link rel="preconnect" href="https://use.fontawesome.com" crossorigin>
<link rel="preconnect" href="//cdnjs.cloudflare.com">
<link rel="preconnect" href="//www.googletagmanager.com">
<link rel="preconnect" href="//www.google-analytics.com">
@npofopr
npofopr / Add_Open_Bash_context_menu.reg
Last active May 18, 2020 13:14
Добавление пункта "Открыть окно Bash здесь" для работы с Ubuntu shell в текущей папке Windows 10
Windows Registry Editor Version 5.00
; Created by:Shawn Brink
; Created on: August 13th 2016
; Tutorial: http://www.tenforums.com/tutorials/60125-open-bash-window-here-context-menu-add-windows-10-a.html
[HKEY_CLASSES_ROOT\Directory\Background\shell\Bash]
@="Открыть окно Bash здесь"
@npofopr
npofopr / lazy-loading.html
Created January 31, 2020 07:17 — forked from droganaida/lazy-loading.html
Intersection Observer + custom lazy loading demo
<html>
<head>
<title>Lazy loading by #Blondiecode</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, "Helvetica Neue", Helvetica, serif;
}
footer {
@npofopr
npofopr / sw.js
Created December 29, 2018 08:06 — forked from ireade/sw.js
Handle broken images with the service worker
self.addEventListener('install', (e) => {
e.waitUntil(
caches.open("precache").then((cache) => cache.add("/broken.png"))
);
});
function isImage(fetchRequest) {
return fetchRequest.method === "GET" && fetchRequest.destination === "image";
}
@npofopr
npofopr / nodejs-gulp-install.txt
Last active December 16, 2018 21:04 — forked from agragregra/nodejs-gulp-install.txt
Node.js + Gulp installation (Ubuntu) one line command
1. Simple:
sudo apt-add-repository -y ppa:brightbox/ruby-ng; sudo apt-get update; sudo apt-get -y install curl ruby2.5 ruby2.5-dev gcc make g++ libffi-dev; curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -; sudo apt-get install -y nodejs;
npm i -g rimraf npm-check-updates;
sudo chown -R $USER:$(id -gn $USER) /home/$USER/.config
3. Длинна командной строки (добавить PROMPT_DIRTRIM=3 в конец и сохранить файл):
sudo nano ~/.bashrc
PROMPT_DIRTRIM=3
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=3356eb28a4f746ca1528)
* Config saved to config.json and https://gist.github.com/3356eb28a4f746ca1528
*/
@npofopr
npofopr / post-receive
Created March 30, 2017 15:13 — forked from lemiorhan/post-receive
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then
/* the page should not change width as content is loaded */
body {
overflow-y: scroll;
}
/* block scrolling without losing the scroll bar and shifting the page */
/* add this class when a modal is open */
body.block-scroll {
overflow: hidden;
overflow-y: scroll !important;