Skip to content

Instantly share code, notes, and snippets.

View ferraghuex's full-sized avatar

Vitalii ferraghuex

View GitHub Profile
@ferraghuex
ferraghuex / index.pug
Created October 24, 2022 21:22 — forked from zeddash/index.pug
Emoting Eyes Exploration #codepen
div.face-container
div.face
div.eye.left
div.lower
div.lid
div.upper
div.lid
div.eye.right
div.lower
div.lid
@ferraghuex
ferraghuex / movie-titles.rb
Created November 4, 2021 15:57 — forked from karmi/movie-titles.rb
Multiple analyzers and query fields in Elasticsearch for auto-completion
require 'tire'
# Tire.configure { logger STDERR, level: 'debug' }
Tire.index('movie-titles') do
delete
create \
settings: {
index: {
analysis: {
This file has been truncated, but you can view the full file.
{
"log": {
"version": "1.2",
"creator": {
"name": "WebInspector",
"version": "537.36"
},
"pages": [
{
"startedDateTime": "2021-04-04T16:15:42.008Z",
Start: 2021-04-04T19:09:37+0300
HOST: ferraghue-macbook.local Loss% Snt Last Avg Best Wrst StDev
1. AS??? 10.8.0.1 0.0% 100 68.3 69.2 67.8 79.0 1.8
2. AS??? ??? 100.0 100 0.0 0.0 0.0 0.0 0.0
3. AS??? 10.82.68.45 0.0% 100 68.3 69.8 68.2 80.6 2.5
4. AS??? 138.197.250.124 0.0% 100 69.2 70.4 68.7 86.1 3.0
5. AS??? 138.197.250.96 0.0% 100 68.9 70.2 68.2 99.5 4.9
6. AS??? 138.197.244.68 0.0% 100 75.2 76.1 74.4 104.2 3.4
7. AS??? 138.197.250.136 0.0% 100 81.1 82.3 80.4 106.0 3.5
8. AS??? 138.197.250.159 0.0% 100 121.6 76.9 74.0 125.9 7.3
5.45.192.0/18
5.255.192.0/18
37.9.64.0/18
37.140.128.0/18
77.75.152.0/21
77.88.0.0/18
84.201.128.0/18
87.250.224.0/19
93.158.128.0/18
95.108.128.0/17
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
@ferraghuex
ferraghuex / Enums.php
Created March 7, 2018 05:29 — forked from jhoff/Enums.php
Laravel Model Enumeration Trait
<?php
namespace App\Traits;
use Illuminate\Support\Str;
use App\Exceptions\InvalidEnumException;
trait Enums
{
/**
"require": {
"laravel/framework": "5.5.*",
"intervention/image": "2.4.*",
"guzzlehttp/guzzle": "6.2.*",
"mews/purifier": "~2.0",
"doctrine/dbal": "2.6.*",
"google/apiclient": "^2.0",
"pusher/pusher-http-laravel": "^4.0"
}
@ferraghuex
ferraghuex / magnific-popup-gallery-image-plus-video.js
Created December 5, 2017 22:18 — forked from hirejordansmith/magnific-popup-gallery-image-plus-video.js
How to show images and video in Magnific Popup Gallery
@ferraghuex
ferraghuex / tokens.md
Created November 19, 2017 15:44 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию

Token-Based Authentication(JWT)

Preconditions:

В данной заметке рассматривается работа JWT с симметичным алгоритмом шифрования (HS256/HS384/HS512)

Основы:

Аутентификация(authentication, от греч. αὐθεντικός [authentikos] – реальный, подлинный; от αὐθέντης [authentes] – автор) - это процесс проверки учётных данных пользователя (логин/пароль). Проверка подлинности пользователя путём сравнения введённого им пароля с паролем, сохранённым в базе данных пользователей;

Авторизация(authorization — разрешение, уполномочивание) - это проверка прав пользователя на доступ к определенным ресурсам.