TLDR: Use for...of
instead of forEach()
in asynchronous code.
For legacy browsers, use for...i
or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
# CLI | |
sudo apt update -y | |
sudo apt install -y \ | |
git curl docker.io \ | |
build-essential pkg-config autoconf bison rustc cargo clang \ | |
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \ | |
libvips imagemagick libmagickwand-dev \ | |
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \ | |
rbenv apache2-utils |
async function fetchNFTsOwnedByUser() { | |
const transferEvents = await nftContract.queryFilter({ | |
address: nftContractAddress, | |
topics: [ | |
ethers.utils.id("Transfer(address,address,uint256)"), | |
null, | |
ethers.utils.hexZeroPad(userWalletAddress, 32) | |
] | |
}); |
/* | |
references | |
fattureincloud | |
https://developers.fattureincloud.it/api-reference/#get-/c/-company_id-/issued_documents | |
toggl | |
https://developers.track.toggl.com/docs/reports/detailed_reports | |
*/ |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.html$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.html [L] | |
</IfModule> | |
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations |
function HTTPResponse( uri ) { | |
var response_code ; | |
var options = { | |
'validateHttpsCertificates' : false | |
}; | |
try { | |
response_code = UrlFetchApp .fetch( uri, options ) .getResponseCode() .toString() ; | |
} | |
catch( error ) { | |
response_code = error .toString() //.match( / returned code (\d\d\d)\./ )[1] ; |
<?php | |
function cache_fetch($key, $group='', $callable, $expiration=0) { | |
$value = wp_cache_get($key, $group); | |
if(!$value) { | |
$value = $callable(); | |
wp_cache_set($key, $value, $group, $expiration); | |
} | |
return $value; | |
} |
(function($){ | |
const data = []; | |
$("fieldset").each(function(i,elCategory){ | |
const category = $(elCategory).find('.fieldset-title').text().replace("Nascondi ", ""); | |
$(elCategory).find("tr").each(function(i,elModule){ | |
const title = $(elModule).find("strong").text(); | |
const active = $(elModule).find("input[type='checkbox']:checked"); | |
data.push({ | |
category: category, | |
title: title, |
<?php | |
try { | |
require_once 'vendor/autoload.php'; | |
$dotenv = Dotenv\Dotenv::createUnsafeImmutable('./'); | |
$dotenv->load(); | |
} catch (Exception $e) { | |
echo(implode("<br>", array( | |
("Caught exception: ".$e->getMessage()."<br>"), | |
"please be sure to install .env support package with 'composer require vlucas/phpdotenv'", | |
"and that a .env is present" |
I hereby claim:
To claim this, I am signing this object: