Skip to content

Instantly share code, notes, and snippets.

@monochromer
monochromer / git-notes.md
Last active March 22, 2024 06:02
git notes

GIT

Подготовка

git config --global user.name "Your Name"
git config --global user.email "your_email@whatever.com"

Для Unix

@monochromer
monochromer / index.html
Last active December 21, 2023 21:56
Простой шаблон для html/css/js
<!DOCTYPE html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--[if lt IE 8]><html class="no-js ie ltie8 ltie9 ltie10" lang="ru"><![endif]-->
<!--[if IE 8]><html class="no-js ie ie8 ltie9 ltie10" lang="ru"><![endif]-->
<!--[if IE 9]><html class="no-js ie gtie8 ie9 ltie10" lang="ru"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html class="no-js" lang="ru"><!--><![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
@monochromer
monochromer / macos-c-build-error.md
Last active December 9, 2023 14:53
Правка ошибок сборки C-проектов на MасOS

https://copyprogramming.com/howto/fatal-error-stdio-h-not-found

Если возникают ошибки типа:

  • clang: error: linker command failed with exit code 1 (use -v to see invocation)
  • <stdio.h> not found
export CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
@monochromer
monochromer / app.js
Created October 31, 2023 06:26
Node.js simple HTTP proxy
const http = require('node:http')
const https = require('node:https')
const events = require('node:events')
const stream = require('node:stream/promises')
const { env } = process
http
.createServer(async (clientRequest, clientResponse) => {
try {
@monochromer
monochromer / caddyfile
Last active October 26, 2023 11:08
Caddy Server and Nginx. Get output of reverse proxy if static file not found
http://localhost:8080 {
root * ./public
@notStatic {
not {
file {
try_files {path} {path}/
}
}
}
@monochromer
monochromer / notes.md
Last active October 22, 2023 14:02
Настройка веб-сервера

Сервер

Проверено на Ubuntu 18.04.4 LTS

Настройка root

Подключаемся

ssh root@IP
@monochromer
monochromer / nginx.conf
Last active October 11, 2023 06:36
Стратегия кэширования от Adobe в Nginx
* https://medium.com/adobetech/an-http-caching-strategy-for-static-assets-configuring-the-server-1192452ce06a
server {
* style.cache-a1b2c3d4e5.css
location ~ \.cache-[a-z0-9]+\. {
etag off;
add_header Cache-Control "public,max-age=31536000,immutable";
}
* index.html
@monochromer
monochromer / web-components.md
Last active September 27, 2023 10:30
Сергей Куликов. Веб-компоненты (Web Components)

Сергей Куликов. Веб-компоненты

Оригинал в twitter-канале jsunderhood: https://twitter.com/jsunderhood/status/1328042944985706512

Кастомные элементы: знакомство.

О том, почему не взлетели веб-компоненты.

О применении кастомных элементов в 2020.