Skip to content

Instantly share code, notes, and snippets.

View kuznetsovandrey76's full-sized avatar

Andrey Kuznetsov kuznetsovandrey76

View GitHub Profile
@TEJA2312
TEJA2312 / otpInputWithValidation.jsx
Last active January 11, 2024 12:19
OTP Input Field With Validation in React Js
import React, { useRef, useEffect, useState } from 'react';
const correctOTP = "123456" // validate from your server
function OtpInputWithValidation({ numberOfDigits }) {
const [otp, setOtp] = useState(new Array(numberOfDigits).fill(""));
const [otpError, setOtpError] = useState(null);
const otpBoxReference = useRef([]);
function handleChange(value, index) {
@muhsalaa
muhsalaa / mailer.js
Created September 23, 2020 13:53
nodemailer setup, work for yandex and google
const nodemailer = require('nodemailer');
const smtpTransport = require('nodemailer-smtp-transport');
const transporter = nodemailer.createTransport(
smtpTransport({
service: 'yandex/google',
host: 'smtp.yandex.ru/smtp.gmail.com',
auth: {
user: 'your@email.com',
pass: 'yourEmailPassword',
@toraritte
toraritte / configure-postgres-to-allow-remote-connection.md
Last active September 4, 2023 01:06
Configure PostgreSQL to allow remote connections

Configure PostgreSQL to allow remote connections

NOTE: This post is a personal update to Neeraj Singh's post. [PostgreSQL must also be configured to allow remote connections][1], otherwise the connection request will fail, even if all firewalls rules are correct and PostgreSQL server is listening on the right port.

Steps

Outline

Couldn't create links, but this is a rather long answer so this may helps.

@NigelEarle
NigelEarle / Knex-Migrations-Seeding.md
Last active June 19, 2024 14:20
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

@egorsmkv
egorsmkv / metrials-go.md
Last active July 4, 2024 14:27
Материалы по Go (golang): мануалы, статьи, книги и ссылки на сообщества

Материалы по Go (golang)

На русском языке

Мануалы и туториалы

  • [Введение в программирование на Go][1]
  • [Маленькая книга о Go][3]
  • [Эффективный Go][2]
  • Есть еще [Краткий пересказ Effective Go на русском языке][4], но 2009 года
@remarkablemark
remarkablemark / Dockerfile
Last active June 18, 2024 04:42
Install node and npm with nvm using Docker.
# set the base image to Debian
# https://hub.docker.com/_/debian/
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
@jak119
jak119 / vmware-horizon-ubuntu-instructions.md
Last active May 28, 2023 01:02
Install VMware Horizon Client on Ubuntu

Rough instructions on insatlling the VMware Horizon Client on Ubuntu

  1. Go to https://www.vmware.com/go/viewclients and download the appropriate version
  2. Open terminal and cd to the directory the .bundle file downloaded to
  3. Run chmod +x VMware-Horizon-Client-*
  4. Execute the .bundle file with sudo ./VMware-Horizon-Client-*
  5. Step through the installer being sure to enable drive redirection
  6. Lauch the application with vmware-view
  7. Connect to server
@anvaka
anvaka / 00.Intro.md
Last active July 4, 2024 09:20
npm rank

npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
@Yimiprod
Yimiprod / difference.js
Last active July 4, 2024 13:14
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
JavaScript resources, all free online. They're ordered in diffuculty from top to bottom.
http://jsforcats.com/
https://www.youtube.com/playlist?list=PLeL6uTxQ-uX_5BpOb2FDNgG6SxjCs59Kv
https://www.youtube.com/watch?v=hQVTIJBZook
https://www.khanacademy.org/computing/computer-science/algorithms
http://speakingjs.com/es5/index.html
http://eloquentjavascript.net/index.html
http://superherojs.com/
https://www.youtube.com/watch?v=8aGhZQkoFbQ