This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers\API; | |
use App\Enums\MenuItemRewardEnum; | |
use App\Enums\OrderCheckStatusEnum; | |
use App\Enums\OrderItemSelectionTypeEnum; | |
use App\Enums\OrderPaymentStatusEnum; | |
use App\Http\Requests\API\UpdateOrderServiceChargesRequest; | |
use App\Http\Requests\API\VoidOrderPaymentRequest; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to install Docker on a Debian-based Linux distribution | |
# Remove any conflicting packages | |
echo "Removing conflicting packages..." | |
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do | |
sudo apt-get remove -y $pkg | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [filterQuery, setFilterQuery] = useState({}) | |
function updateFilterQUery(term, value) { | |
let filters = { ...filterQuery } | |
if (term != 'page') { | |
filters['page'] = 1 | |
} | |
if (value) { | |
filters[term] = value | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~ | |
curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh | |
sudo bash /tmp/nodesource_setup.sh | |
sudo apt install nodejs | |
node -v | |
Output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update && sudo apt upgrade -y | |
sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pm2 start artisan --name laravel-worker --interpreter php -- queue:work --tries=3 --daemon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function uniqueBy(arr, fn) { | |
var unique = {}; | |
var distinct = []; | |
arr.forEach(function (x) { | |
var key = fn(x); | |
if (!unique[key]) { | |
distinct.push(key); | |
unique[key] = true; | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo chmod -R gu+w storage bootstrap/cache | |
sudo chmod -R guo+w storage bootstrap/cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If: # Creating Server TCP listening socket ::1:6379: bind: Cannot assign requested address | |
Do: | |
In my case error was: redis-server.service: Can't open PID file /var/run/redis/redis-server.pid (yet?) after start: No such file or directory after starting redis server. Each time restarting the redis server I was facing similar issue. | |
Editing nano /etc/systemd/system/redis.service and adding this line below [Service]: | |
ExecStartPost=/bin/sh -c "echo $MAINPID > /var/run/redis/redis.pid" | |
It suppose to look like this: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Decimal to Fraction String</title> | |
</head> | |
<body> | |
<div> | |
<input type='number' id='decimalInput' /> <button type='button' onClick="toFraction()">Convert</button> |