Skip to content

Instantly share code, notes, and snippets.

View petyappetrov's full-sized avatar
🏇
Work hard - play hard

Petr Petrov petyappetrov

🏇
Work hard - play hard
View GitHub Profile
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2008-2016 Quantron Systems LLC.
// All Rights Reserved.
//
// This file is part of the Pakmil project.
// For conditions of distribution and use,
// please contact sales@quantron-systems.com
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2008-2016 Quantron Systems LLC.
// All Rights Reserved.
//
// This file is part of the Pakmil project.
// For conditions of distribution and use,
// please contact sales@quantron-systems.com
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2008-2016 Quantron Systems LLC.
// All Rights Reserved.
//
// This file is part of the Pakmil project.
// For conditions of distribution and use,
// please contact sales@quantron-systems.com
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
function sequence (start, step) {
return function () {
return start += step
}
}
/////////////////////////////////////////////////////////////////////////////////////////
function square (a) {
return a * a
import React, { useState, useEffect } from 'react'
import { createPortal } from 'react-dom'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import { useSpring, animated, config } from 'react-spring'
const Overlay = styled(animated.div)`
position: fixed;
top: 0;
bottom: 0;
@petyappetrov
petyappetrov / useRecaptcha
Last active January 27, 2021 05:59
Google reCAPTCHA V2 invisible mode make in React Hooks
import { useCallback, useEffect, useRef } from "react";
const RECAPTCHA_SCRIPT_URL = "https://www.google.com/recaptcha/api.js";
const RECAPTCHA_SIZE = "invisible";
const RECAPTCHA_RESPONSE_KEY = "responseCallback";
const RECAPTCHA_EXPIRED_KEY = "expiredCallback";