Skip to content

Instantly share code, notes, and snippets.

View aandrewww's full-sized avatar
:octocat:
Discovering

Andrew Avdeev aandrewww

:octocat:
Discovering
View GitHub Profile
@zmts
zmts / knex_ssl.md
Last active September 3, 2023 23:21
Can't connect to PostgreSQL. SSL error with Nodejs/Knexjs (Digital ocean)

Can't connect to PostgreSQL. SSL error with Nodejs/Knexjs (Digital ocean)

Issues:

Case 1

{
  client: 'pg',
  connection: {
    host: process.env.DB_HOST,
    port: process.env.DB_PORT,
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active June 2, 2024 11:24
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@1hakr
1hakr / example.com
Last active January 31, 2024 01:16
Supercharge your NGIX config
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name example.com;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request
@FZambia
FZambia / index.html
Last active June 5, 2019 08:48
Centrifuge library Habr example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!-- Обратите внимание, что клиент тут импортируется из ветки c2 репозитория centrifuge-js -->
<script type="text/javascript" src="https://rawgit.com/centrifugal/centrifuge-js/c2/dist/centrifuge.min.js"></script>
</head>
<body>
<input type="text" id="input" />
<script type="text/javascript">
Задача:
Используя открытый API (https://dog.ceo/dog-api/) написать небольшое web-приложение на стэке React 16.3.x + Redux + React-Router.
Приложение должно иметь более чем один роут: список собак, страница конкретной собаки.
Сборка должна производиться с помощью webpack версии 4.x.x.
Покрытие тестами (хотя бы одного компонента) с помощью Jest
Обязательное и обоснованное использование EcmaScript 6+ фич (babel-present-env).
Код должен быть отформатирован по eslint airbnb (https://www.npmjs.com/package/eslint-config-airbnb)
Дизайн и структура файлов/папок проекта приложения остаётся на совесть выполняющего данное тестовое задание.
@GoodBoyDigital
GoodBoyDigital / pixi-performance-tips.txt
Last active June 29, 2023 13:40
Pixi Performance Tips
Global :
- Only optimize when you need to! Pixi can handle a fair amount of content off the bat.
- Be mindful of the complexity of your scene. The more objects you add the slower things will end up.
- Order can help, for example sprite / graphic / sprite / graphic is slower than sprite / sprite / graphic / graphic
- Some older mobile devices run things a little slower. passing in the option 'legacy:true' to the renderer can help with performance
- Culling, is disabled by default as its often better to do this at an application level. If you are GPU it will improve performance, if you are CPU bound - it will degrade performance
Sprites:
- Use spritesheets where possible to minimize total textures
- Sprites can be batched with up to 16 different textures (dependent on hardware)
@zmts
zmts / tokens.md
Last active June 19, 2024 09:18
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active June 19, 2024 03:06
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@nrollr
nrollr / MongoDB_macOS_Sierra.md
Last active April 1, 2024 16:23
Install MongoDB on Sierra using Homebrew

Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active June 7, 2024 20:53
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :