What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-22 00:52:15
formiks basic tutorial
import React from 'react'; import { useFormik } from 'formik'; const SignupForm = () => { // Pass the useFormik() hook initial form values and a submit function that will // be called when the form is submitted const formik = useFormik({ ini... Add solution -
Javascript 2021-11-21 15:46:24
react native passing parameters to routes
Copy function HomeScreen({ navigation }) { return ( <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> <Text>Home Screen</Text> <Button title="Go to Details" onPress=... Add solution -
Javascript 2021-11-21 14:40:31
code to convert rgb to hsl color
// see: https://en.wikipedia.org/wiki/RGB_color_model // see: https://en.wikipedia.org/wiki/HSL_and_HSV // expects R, G, B, Cmax and chroma to be in number interval [0, 1] // returns undefined if chroma is 0, or a number interval [0, 360] degrees functio... Add solution -
Javascript 2021-11-21 06:34:17
javascript websocket example code
/* * Link starts with ws:// or wss:// * ws:// for non ssl * wss:// for ssl */ let ws = new WebSocket('LINK_HERE') ws.addEventListener('open', function (event) { //WebSocket Connected console.log('connected') }) ws.addEventListener('messag... Add solution -
Other 2021-11-20 22:31:18
given an array a of n non-negative integers, count the number of unordered pairs
var debug = 0; function bruteForce(a){ let answer = 0; for (let i = 0; i < a.length; i++) { for (let j = i + 1; j < a.length; j++) { let and = a[i] & a[j]; if ((and & (and - 1)) == 0 && and != 0){ answer+... Add solution