This is a vanilla JS version of the infamous Debounce function.
Debounce allows you to delay calls to a function in order to prevent spamming.
A good example of it's application would be an event handler whose event could be fired in multiple time in quick succession.
This function can be used to support JavaScript for the BackOffice non-react pages.
This guide describes the setup process to expose your local (e.g. https://localhost:3000) to the outside web.
This is helpful, for example, when attempting to test and inspect local code changes on a mobile device.
Visit ngrok's website, setup an account & grab the exe
LeetCode | TwoSum
Difficulty: ✅☑☑☑☑
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
You can return the answer in any order.
// For each side of a set of arrays | |
const mergeArrays = (left, right) => { | |
// Iterate each 0th value moving the vaues into our sorted array | |
let sortVals = []; | |
while(left.length && right.length) { | |
(left[0] < right[0]) ? sortVals.push(left.shift()) : sortVals.push(right.shift()); | |
} | |
// Return sorted array & anything leftover from either side |
#include <stdio.h> | |
#include <cs50.h> | |
string cardType; | |
// Prompt for a valid card number | |
long getCardNumber(void) | |
{ | |
long cardNumber; | |
cardNumber = get_long("Please enter the card number: "); |
This snippet describes a workaround which can help when you're having issues connecting to a particular resource.
This is of course a temporary work around, however, can certainly get you out of a muddle fast!
For example, if you're unable to get to the nuget host, this guide can help you resolve this (temporarily!)
You can confirm whether you're having DNS issues, if for example, other connectivity otherwise appears fine, and a particular URL or resource will not resolve.
<!DOCTYPE HTML> | |
<html> | |
<!-- | |
@author Ben Poole, http://benpoole.com | |
Example HTML5 code for playing with the local WebKit (Opera too?) SQL database. | |
@see http://benpoole.com/weblog/201106222227 | |
--> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Winkles Of The World Unite!</title> |
@Echo off | |
setlocal EnableDelayedExpansion | |
set 1=auto | |
set 2=off | |
set 3=exit | |
Echo/ | |
echo " __ __ __ __ "; | |
echo " / | / | / | / | "; | |
echo " $$ | $$ | __ __ ______ ______ ______ $$ | $$ | "; | |
echo " $$ |__$$ |/ | / | / \ / \ / \ ______ $$ | $$ | "; |