This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// private static String MATRIX_NON_NULL_AND_ACTIVE_NON_NULL = "matrix non null and active non null"; | |
// private static String MATRIX_NULL_AND_ACTIVE_NON_NULL = "matrix null and active non null"; | |
// private static String MATRIX_NULL_AND_ACTIVE_NULL = "matrix null and active null"; | |
// private static String EXCEPTION = "Add a value for active or leave empty matrix too"; | |
// public String searchForUserAndRole(String matrix, String active) { | |
// String response = ""; | |
// if (matrix != null && active != null) { | |
// response = MATRIX_NON_NULL_AND_ACTIVE_NON_NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2.1 | |
jobs: | |
deploy: | |
docker: | |
- image: cimg/node:12.18.4 | |
steps: | |
- checkout | |
- node/install-packages | |
- run: npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useRef, useEffect } from 'react' | |
export const useTimer = ({ initialStartTime = 0, shouldStartOnMount = false }) => { | |
const [milliseconds, setMilliSeconds] = useState(0) | |
const intervalRef = useRef() | |
const startTime = useRef() | |
const play = () => { | |
if (intervalRef.current) return | |
if (!startTime.current) { | |
startTime.current = new Date().getTime() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Yup from 'yup' | |
import { handleErrorCode } from './auth' | |
import { makeRequest } from '../services/requests' | |
import getCurrentPosition from '../../utils/getCurrentPosition' | |
import log from '../../utils/log' | |
const requestSchema = Yup.object().shape( { | |
endpoint: Yup.string().required(), | |
method: Yup.string().default( 'GET' ), | |
query: Yup.object().default( {} ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.reddit.com/r/learnprogramming/comments/3456xv/convert_rgb_color_to_wavelengthfrequency/ | |
// https://www.alanzucconi.com/2015/09/30/colour-sorting/ | |
const WHITE_STRING = parseInt( 'FFFFFF', 16 ) | |
const NUMBER_OF_COLORS = 50 | |
const genRandomInt = (min, max) => Math.floor(Math.random() * (max - min)) + min | |
const getHueFromRGB = ({ red, green, blue }) => { | |
const min = Math.min(Math.min(red, green), blue); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class extends Component { | |
constructor (props) { | |
super(props) | |
this.element = null | |
} | |
componentDidMount = () => { | |
this.element = document.getElementById(this.props.className) | |
} | |
changeHeight = () => { | |
this.element.scrollIntoView({behavior: 'smooth'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const degToRad = deg => (deg / 180) * Math.PI | |
const radToDeg = rad => rad * 180 / Math.PI; | |
class Turtle { | |
constructor(ctx) { | |
this.ctx = ctx | |
// Set initial orientation and position | |
this.orientation = 0; | |
this.position = {x: 0, y: 0} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (initialState, actionHandlers) => | |
(state = initialState, action) => | |
actionHandlers.hasOwnProperty(action.type) | |
? actionHandlers[action.type](state, action) | |
: state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@ts-check | |
const progress = ({ | |
value, | |
length=40, | |
title = " ", | |
vmin=0.0, | |
vmax=1.0, | |
progressive = false | |
}) => { |
NewerOlder