What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2021-09-22 23:42:02
node-redis
// node-redis to promise, because node-redis not support promise import bluebird from 'bluebird' import { Commands, createClient } from 'redis' const client = createClient({ host: process.env.REDIS_HOST, port: parseInt(process.env.REDIS_PORT), passwo... Add solution -
Javascript 2021-09-22 06:51:01
Web3 Example
// Here's how we would access our contract: var abi = /* abi generated by the compiler */ var ZombieFactoryContract = web3.eth.contract(abi) var contractAddress = /* our contract address on Ethereum after deploying */ var ZombieFactory = ZombieFactoryCont... Add solution -
Other 2021-09-22 06:49:02
dont allow user to insert number greater than particular number
function isNumberKey(e) { var currentChar = parseInt(String.fromCharCode(e.keyCode), 10); if(!isNaN(currentChar)){ var nextValue = $("#txthour").val() + currentChar; //It's a string concatenation, not an addition if(pars... Add solution -
Javascript 2021-09-20 20:46:04
react native textinput min number max nuber
const onCheckLimit = (value: string) => { const parsedQty = Number.parseInt(value) if (Number.isNaN(parsedQty)) { setQuantity(0) //setter for state } else if (parsedQty > 10) { setQuantity(10) } else { setQuantity... Add solution -
Javascript 2021-09-20 07:41:03
showing difference between dates in minutes js
const today = new Date(); const endDate = new Date(startDate.setDate(startDate.getDate() + 7)); const days = parseInt((endDate - today) / (1000 * 60 * 60 * 24)); const hours = parseInt(Math.abs(endDate - today) / (1000 * 60 * 60) % 24); const minutes = pa... Add solution -
Other 2021-09-19 15:10:05
converting string to interer
int i = Integer.parseInt(myString); Add solution