This file contains 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 | |
class WebSocket | |
{ | |
private array $clients = []; | |
private $server; | |
private int $sleep = 0; |
This file contains 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
let checked = document.querySelectorAll('form#group-store select[name="employees[]"] :checked'); | |
checked = [...checked].map(option => option.value) |
This file contains 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
(http|ftp|https|ws|wss):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-]) |
This file contains 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 slugInput = document.querySelector('form input[name="slug"]'); | |
const slugText = slugInput.value; | |
var slugInputIsEdit = false; | |
slugInput.onchange = (e) => { | |
slugInputIsEdit = true; | |
} | |
document.querySelector('form input[name="name"]').onkeyup = (e) => { |
This file contains 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
mysql -u root -p laravel_and_vite < /home/darkside/Downloads/world.sql |
This file contains 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
#include "iostream" | |
#define EPSILON 0.0000001 // least minimum value for comparison | |
using namespace std; | |
class Solution { | |
public: | |
int mySqrt(double x) { | |
if (x <= 0) | |
return 0; |
This file contains 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
# Set default permissions for directories | |
find /home/me -type d -exec chmod 755 {} \; | |
# Set default permissions for files | |
find /home/me -type f -exec chmod 644 {} \; |
This file contains 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
docker run --rm -v $(pwd):/app -w /app php php artisan serve | |
docker run --rm -v $(pwd):/app composer install | |
https://docs.docker.com/engine/reference/commandline/container_ls/ | |
docker container ls --all | |
docker rm -vf $(docker ps -aq) | |
docker kill $(docker ps -q) | |
docker kill <container_id> | |
docker rm <container_id_or_name> |
This file contains 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
https://picsum.photos/400/300 | |
https://dummyimage.com/250/ffffff/000000 | |
https://dummyimage.com/250x300 | |
https://dummyimage.com/300.png/09f/fff | |
https://dummyimage.com/ |
This file contains 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
<script> | |
var isTabActive; | |
window.onfocus = function () { | |
console.log("onfocus"); | |
}; | |
window.onblur = function () { | |
console.log("onblue"); | |
}; |