Skip to content

Instantly share code, notes, and snippets.

@ValeryVerkhoturov
ValeryVerkhoturov / rmq_passwd_hash.py
Created March 9, 2024 17:44 — forked from anapsix/rmq_passwd_hash.py
generate RabbitMQ compatible SHA256 password hash
#!/usr/bin/env python
# details on rabbitMQ password hashing
# https://www.rabbitmq.com/passwords.html#computing-password-hash
from __future__ import print_function
import base64
import os
import hashlib
import struct
import getpass
import React from "react";
let comments = [
{
id: 1,
text: "message 1",
},
{
id: 2,
text: "message 2",
@ValeryVerkhoturov
ValeryVerkhoturov / diff.py
Created January 5, 2024 19:28 — forked from adamnew123456/diff.py
An implementation of the Myers diff algorithm
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
@ValeryVerkhoturov
ValeryVerkhoturov / docker-compose.redis.yml
Last active August 14, 2023 17:54
docker-compose.redis.yml
version: '3.9'
services:
redis:
image: 'bitnami/redis:latest'
volumes:
- redis:/bitnami/redis/data
environment:
REDIS_PASSWORD: xcfgyvubhiuoijpKMNJkoojihuhgvcflmkn
networks:
@ValeryVerkhoturov
ValeryVerkhoturov / example.api.ts
Created July 17, 2023 07:00 — forked from epicbytes/example.api.ts
NextJS Authorization Files
/*** function that used as middleware ***/
accessToken: async (name) => {
if (typeof document === "undefined") return "";
let token = document.cookie
.split(";")
.filter((cookie) => cookie.startsWith("token"))[0];
if (!token) {
const response = await fetch("/api/refresh", { method: "POST" });
import React from 'react';
type Color = string
interface Param {
id: number;
name: string;
type: "string" | "checkbox";
}
@ValeryVerkhoturov
ValeryVerkhoturov / pluralize-ru.js
Created July 13, 2023 21:00 — forked from znechai/pluralize-ru.js
JavaScript - Plural forms for russian words
/**
* Plural forms for russian words
* @param {Integer} count quantity for word
* @param {Array} words Array of words. Example: ['депутат', 'депутата', 'депутатов'], ['коментарий', 'коментария', 'комментариев']
* @return {String} Count + plural form for word
*/
function pluralize(count, words) {
var cases = [2, 0, 1, 1, 1, 2];
return count + ' ' + words[ (count % 100 > 4 && count % 100 < 20) ? 2 : cases[ Math.min(count % 10, 5)] ];
}
import React, { useState } from 'react';
interface Param {
name: string;
value: string;
}
interface Model {
params: Param[];
}
@ValeryVerkhoturov
ValeryVerkhoturov / nextjs-deploy.md
Created March 6, 2023 21:31 — forked from jjcodes78/nextjs-deploy.md
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@ValeryVerkhoturov
ValeryVerkhoturov / code.csv
Last active November 12, 2022 22:23
Внутренний код - Код ФГОС ВО
chipher specialty
КАМО 15.04.04
КБМО 12.04.04
КВМО 09.04.01
КММО 01.04.02
КРМО 15.04.06
КСМО 27.04.03
КУМО 27.04.04
КФМО
КАБО 15.03.04