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 / dequeue.cc
Last active April 16, 2024 10:25
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
@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 / CDLL.cc
Created March 17, 2024 06:58
Doubly Circular Linked List
/**
* Circular Double Linked List
*
*/
#include "iostream"
using namespace std;
struct Node {
@mudassaralichouhan
mudassaralichouhan / CLL.cc
Created March 10, 2024 20:00
It is a linked list whose nodes are connected in such a way that it forms a circle.
#include "iostream"
using namespace std;
struct Node {
int id;
string name;
Node *next;
Node(unsigned int id, string name, Node *next = nullptr) :
@mudassaralichouhan
mudassaralichouhan / DLL.cc
Created March 3, 2024 19:55
Double Link List [$ g++ main.cc -o main.o && ./main.o]
#include "iostream"
using namespace std;
struct Node {
int id;
string name;
Node *previous;
Node *next;
@mudassaralichouhan
mudassaralichouhan / SLL.cc
Created February 4, 2024 14:10
Single link list
#include "iostream"
using namespace std;
struct Node {
unsigned int no;
string name;
Node *next;
Node(unsigned int data, string name) : no(data), name(name), next(nullptr) {};
@mudassaralichouhan
mudassaralichouhan / isTabActive.html
Created January 6, 2024 19:33
This approach can be used to track if a user has left a webpage by switching to another browser tab or application.
<script>
var isTabActive;
window.onfocus = function () {
console.log("onfocus");
};
window.onblur = function () {
console.log("onblue");
};
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/
# 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 {} \;
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>