×
Clear all filters including search bar
Valeri Tandilashvili's Personal Professional Blog
async function start() {
try {
fetch("https://dog.ceo/api/breeds/list/all").then(function(response) {
return response.json()
}).then(function(data) {
createBreedList(data.message)
})
} catch (e) {
console.log("There was a problem fetching the breed list.")
}
}
Fetch with async
& await
keywordsasync function start() {
try {
const response = await fetch("https://dog.ceo/api/breeds/list/all")
const data = await response.json()
createBreedList(data.message)
} catch (e) {
console.log("There was a problem fetching the breed list.")
}
}
title
element from $xml
function value_in($element_name, $xml, $content_only = true) {
if ($xml == false) {
return false;
}
$found = preg_match('#<'.$element_name.'(?:\s+[^>]+)?>(.*?)'.
'</'.$element_name.'>#s', $xml, $matches);
if ($found != false) {
if ($content_only) {
return $matches[1]; //ignore the enclosing tags
} else {
return $matches[0]; //return the full pattern match
}
}
// No match found: return false.
return false;
}
$title = value_in('title', $xml);
dbname
except the two table: table1
and table2
mysqldump -u root -p --ignore-table=dbname.table1 --ignore-table=dbname.table2 dbname > dbname.sql
/var/www/website.com/storage/logs/laravel.log
du -h --max-depth=1
purge binary logs before ‘2022-03-03’;
price
value$inventory = array(
array("type"=>"fruit", "price"=>3.50),
array("type"=>"milk", "price"=>2.90),
array("type"=>"pork", "price"=>5.43),
);
The solution is to use array_multisort
function$price = array();
foreach ($inventory as $key => $row)
{
$price[$key] = $row['price'];
}
array_multisort($price, SORT_DESC, $inventory);
In PHP 5.5 or later array_column
function can be used$price = array_column($inventory, 'price');
array_multisort($price, SORT_DESC, $inventory);
.blade.php
file located at:\resources\views\external\calculator
<div class="container">
@include('external.calculator.panel')
</div>
$item_presale_tokens = old('values.0');
$item_liquidity_tokens = old('values.1');
Form html looks like this:<div class="form-group d-flex border-bottom-0">
<div class="form-equal-inputs">
<input type="number" step="1" min="1" value="{{ $item_presale_tokens }}" class="form-control {{ $errors->has('values.0') ? 'is-invalid' : '' }}" name="values[]" placeholder="Value"/>
</div>
</div>
<div class="form-group d-flex border-bottom-0">
<div class="form-equal-inputs">
<input type="number" step="1" min="1" value="{{ $item_liquidity_tokens }}" class="form-control {{ $errors->has('values.1') ? 'is-invalid' : '' }}" name="values[]" placeholder="Value"/>
</div>
</div>