Skip to content

Instantly share code, notes, and snippets.

View mudassaralichouhan's full-sized avatar
:octocat:
It’s not a bug; it’s an undocumented feature.

Mudassar Ali mudassaralichouhan

:octocat:
It’s not a bug; it’s an undocumented feature.
View GitHub Profile
@mudassaralichouhan
mudassaralichouhan / mySqrt.cpp
Last active July 22, 2023 19:46
SquareRoot Here is a very awesome code to find sqrt and even faster than original sqrt function.
#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;
@mudassaralichouhan
mudassaralichouhan / demo.sh
Created June 25, 2023 10:06
import *.sql file form terminal
mysql -u root -p laravel_and_vite < /home/darkside/Downloads/world.sql
(http|ftp|https|ws|wss):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])
@mudassaralichouhan
mudassaralichouhan / select.js
Created February 1, 2023 08:55
multi select get values
let checked = document.querySelectorAll('form#group-store select[name="employees[]"] :checked');
checked = [...checked].map(option => option.value)
@mudassaralichouhan
mudassaralichouhan / WebSocket.php
Last active January 31, 2023 11:46
web socket example
<?php
class WebSocket
{
private array $clients = [];
private $server;
private int $sleep = 0;
@mudassaralichouhan
mudassaralichouhan / phpstorm.desktop
Created January 28, 2023 14:37
move on /usr/share/application/
[Desktop Entry]
Version=2021.2.2
Name=PHP Storm
Comment=PHP Programing Web IDE Text Editor
Keywords=Programming;IDE;Web;Text;Editor
Exec=/opt/php-storm-212.5284.49/bin/phpstorm.sh
Terminal=false
Type=Application
Icon=/opt/php-storm-212.5284.49/bin/phpstorm.svg
Categories=JetBrain;Programming;WebIDE;
<?php
namespace App\WebSocket;
class Notification extends WebSocket
{
}
const from = document.querySelector('form#group-send-message');
from.onsubmit = (e) => {
e.preventDefault();
const selectedGroup = document.querySelector('div[data-active]');
if (! selectedGroup) {
swal('Please! first Select a group chat.', 'error');
return;
}
@mudassaralichouhan
mudassaralichouhan / index.html
Created January 18, 2023 16:48
Socket programming in PHP [mini chat app]
<!DOCTYPE html>
<html lang="">
<head>
<meta charset='UTF-8'/>
<title>Chat Room</title>
</head>
<body>
<input type="text" name="name">
<input type="text" name="message"/>
for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine; do
echo "Resetting trial period for $product"
echo "removing evaluation key..."
rm -rf ~/.config/$product*/eval
# Above path not working on latest version. Fixed below
rm -rf ~/.config/JetBrains/$product*/eval
echo "removing all evlsprt properties in options.xml..."