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 / detecting-image-404.html
Created November 2, 2022 18:13
Detecting an image 404 in Javascript
<img src="{{ $vendor->image }}" onerror="ImgError(this)">
<script type="text/javascript">
function ImgError(source){
source.src = 'http://bbb.test/assets/images/placeholder.png';
source.onerror = "";
return true;
}
</script>
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..."
@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;
@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
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>
#include <vector>
#include <algorithm>
vector<int> findTopThree(vector<int>& score) {
vector<int> topThree;
int f = INT_MIN, s = INT_MIN, t = INT_MIN;
for (int i = 0; i < score.size(); i++) {
if (score[i] > f) {
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/
@mudassaralichouhan
mudassaralichouhan / CDLL.cc
Last active November 13, 2024 17:25
Link List [$ g++ main.cc -o main.o && ./main.o]
/**
* Circular Double Linked List
*
*/
#include "iostream"
using namespace std;
struct Node {
@mudassaralichouhan
mudassaralichouhan / stack-using-unique_ptr.cc
Last active April 8, 2024 20:57
Stack principle of Last In First Out (LIFO)
#include "iostream"
#include "memory"
struct StackHolder {
std::string data;
};
class Stack {
private:
int idx = -1;
@mudassaralichouhan
mudassaralichouhan / dequeue.cc
Last active April 26, 2024 10:30
Queue FIFO.
/**
* Dequeue:
* Dequeue is also known as Double Ended Queue.
* As the name suggests double ended,
* it means that an element can be inserted or removed from both ends of the queue, unlike the other queues
* in which it can be done only from one end. Because of this property, it may not obey the First In First Out property.
*
* implement using doubly linked list
*
* Operation Description Time Complexity