Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrey Drozdov andreydro

  • Poland
View GitHub Profile
@andreydro
andreydro / README.md
Created Jun 22, 2022 — forked from lopspower/README.md
Hexadecimal color code for transparency
View README.md

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@andreydro
andreydro / recaptcha.md
Last active Jan 6, 2022
Integrating recaptcha to Next.js App (React) + Rails API
View recaptcha.md

Prepare:

  • Go to this URL (https://www.google.com/recaptcha/admin/create) to create a reCAPTCHA app.

  • Give the reCAPTCHA a label.

  • Select reCAPTCHA v2.

  • Add the domain name of where this captcha checkbox will be used. To test this checkbox on your development server, add localhost as your domain name.

  • Click Submit.

@andreydro
andreydro / use_timeout.js
Last active Sep 18, 2021
Hook that helps to setTimeout in react in correct way (Typescript)
View use_timeout.js
import { useEffect, useMemo } from 'react'
type tTimeoutId = number
const useTimeout = () => {
const timeoutsSet = useMemo(() => new Set<tTimeoutId>(), [])
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const _setTimeout = (callback: any, delay?: number) => {
const timeout = setTimeout(callback, delay)
@andreydro
andreydro / rails http status codes
Created Nov 11, 2019 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
View rails http status codes
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@andreydro
andreydro / index.md
Created Mar 5, 2018 — forked from rstacruz/index.md
Rails models cheatsheet
View index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one