Results: 1024
Fetch with promises
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
keywords
async 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.")
  }
}
JS Projects
To-Do App (adding / deleting items to the list) https://codepen.io/Tandilashvili/pen/BaYdqMz?editors=1010 https://www.youtube.com/watch?v=HQuJzGU7TWg http://sibrdzne.ge/ot/projects/JS/to-do-app/index.html To-Do List App (adding / deleting / editing items to the list) https://codepen.io/Tandilashvili/pen/OJQBoRQ https://www.youtube.com/watch?v=b8sUhU_eq3g http://sibrdzne.ge/ot/projects/JS/to-do-app-with-edit/index.html Multiple Choice Quiz App https://codepen.io/Tandilashvili/pen/GRQYGGb https://www.youtube.com/watch?v=49pYIMygIcU http://sibrdzne.ge/ot/projects/JS/multiple-choice-quiz/index.html Dogs, (API 🐶 Fetch, Promises & Async Await) https://codepen.io/learnwebcode/pen/LYNWQgg https://www.youtube.com/watch?v=AVmGmLFcukM http://sibrdzne.ge/ot/projects/JS/dog-api/index.html Weather App (API) https://codepen.io/Tandilashvili/pen/WNMXPoB https://www.youtube.com/watch?v=KqZGuzrY9D4 http://sibrdzne.ge/ot/projects/JS/weather-app/index.html Image Carousel https://codepen.io/Tandilashvili/pen/RwQxMVm https://www.youtube.com/watch?v=9HcxHDS2w1s http://sibrdzne.ge/ot/projects/JS/image-carousel/index.html Clock https://codepen.io/Tandilashvili/pen/vYdVXVR https://www.youtube.com/watch?v=Ki0XXrlKlHY http://sibrdzne.ge/ot/projects/JS/clock/index.html Calculator https://codepen.io/Tandilashvili/pen/OJQBBZL https://www.youtube.com/watch?v=QS6Y0ezhyCs http://sibrdzne.ge/ot/projects/JS/calculator/index.html Movie App (API) https://codepen.io/Tandilashvili/pen/BaYqbNK https://www.youtube.com/watch?v=9Bvt6BFf6_U http://sibrdzne.ge/ot/projects/JS/movie-app/index.html Books List App (class, localStorage) https://codepen.io/Tandilashvili/pen/RwQqgVw?editors=1010 https://www.youtube.com/watch?v=JaMCxVWtW58 http://sibrdzne.ge/ot/projects/JS/books-list-app/index.html Budget App (edit, delete, localStorage) https://codepen.io/Tandilashvili/pen/ExQOvxB https://www.youtube.com/watch?v=SQbCwfGC7EM http://sibrdzne.ge/ot/projects/JS/budget-app/index.html Task Management (Draggable, with statuses) https://codepen.io/Tandilashvili/pen/wvyRMLE https://www.youtube.com/watch?v=m3StLl-H4CY http://sibrdzne.ge/ot/projects/JS/task-management/index.html Navigation Bar https://codepen.io/Tandilashvili/pen/WNMLwOq https://www.youtube.com/watch?v=hy2OwJE_OEA http://sibrdzne.ge/ot/projects/JS/navigation-bar/index.html Multi Step Form https://codepen.io/Tandilashvili/pen/dydwMqe https://www.youtube.com/watch?v=JFfVilQSius http://sibrdzne.ge/ot/projects/JS/multi-step-form/index.html Piano https://codepen.io/Tandilashvili/pen/GRQPXNj https://www.youtube.com/watch?v=vjco5yKZpU8 http://sibrdzne.ge/ot/projects/JS/piano/index.html Math Game (+ - * two numbers) https://codepen.io/learnwebcode/pen/mdPMBjL https://www.youtube.com/watch?v=EVze4Cq-dZ8 http://sibrdzne.ge/ot/projects/JS/math-game/index.html Word Beater Game https://codepen.io/Tandilashvili/pen/XWZxOOV?editors=1010 https://www.youtube.com/watch?v=Yw-SYSG-028 http://sibrdzne.ge/ot/projects/JS/word-beater-game/index.html Tic Tac Toe Game https://codepen.io/Tandilashvili/pen/jOZeQWw https://www.youtube.com/watch?v=B3pmT7Cpi24 http://sibrdzne.ge/ot/projects/JS/tic-tac-toe-game/index.html Snake Game (Canvas) https://codepen.io/Tandilashvili/pen/abqVXOm https://www.youtube.com/watch?v=9TcU2C1AACw http://sibrdzne.ge/ot/projects/JS/snake-game/index.html Pong Game https://codepen.io/Tandilashvili/pen/RwQEBqw https://www.youtube.com/watch?v=PeY6lXPrPaA http://sibrdzne.ge/ot/projects/JS/pong-game/index.html
Returns value of
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);
Export all table except ...
Exports all table from
dbname
except the two table:
table1
and
table2
mysqldump -u root -p --ignore-table=dbname.table1 --ignore-table=dbname.table2 dbname > dbname.sql
Error log file address
Error log file location:
/var/www/website.com/storage/logs/laravel.log
File & folder sizes
Shows files and folders with their sizes in the current directory
du -h --max-depth=1
Delete binary logs
Deletes binary logs created before the specified date
purge binary logs before ‘2022-03-03’;
Sort array of arrays by sub-array values
We need to sort the array by
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);
Include .blade.php file
Includes
.blade.php
file located at:
\resources\views\external\calculator
<div class="container">
    
    @include('external.calculator.panel')

</div>
Makes the array member stay filled after backend validation is failed
Makes the array member stay filled if the form is not successfully validated on the backend:
$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>
Results: 1024