What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-05 22:44:02
javascript sleep function
const sleep = (milliseconds) => { return new Promise(resolve => setTimeout(resolve, milliseconds)) } /*Use like so*/ async function timeSensativeAction(){ //must be async func //do something here await sleep(5000) //wait 5 seconds //contin... Add solution -
Other 2021-09-05 13:14:02
knex migrate in docker compose
"use strict"; const config = require("./knexfile"); const Knex = require("knex"); const knex = Knex(config); async function runMigrations(retries, delay) { for (let i = 1; i !== retries; i++) { try { return awa... Add solution -
Other 2021-09-05 08:48:03
status codes
100 Continue 101 Switching Protocols 103 Early Hints 200 OK 201 Created 202 Accepted 203 Non-Authoritative Information 204 No Content 205 Reset Content 206 Partial Content 300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 304 Not Modified... Add solution -
Javascript 2021-09-05 07:53:02
get time from server and run it from there in javascript
var serverTime = 1490856278000; var expected = serverTime; var date; var h; var m; var s; var now = performance.now(); var then = now; var dt = 0; var nextInterval = (interval = 1000); setTimeout(step, interval); ... Add solution -
Javascript 2021-09-05 06:43:02
callback in response node.js
//you can only return a value from an async function by passing in a callback function like so: function longRunningFunction(param1, callback){ setTimeout(function(){ var results="O High there!"; callback(results); }, ... Add solution -
Html 2021-09-04 18:29:02
slider tailwind css
<div class="relative"> <div class="absolute inset-0 w-screen h-screen bg-pink-500 text-white flex items-center justify-center text-5xl transition-all ease-in-out duration-1000 transform translate-x-0 slide">Hello</di... Add solution -
Javascript 2021-09-03 09:07:02
javascript typewriter effect
// *** JS Typewriter Effect *** let i = 0; let target = document.getElementById("target"); let text = target.innerHTML; target.innerHTML = ' '; let speed = 75; //speed duration of effect in millisec typeWriter(); //to c... Add solution
Best helpers
Ranking is empty