Skip to content

Instantly share code, notes, and snippets.

View bhushan's full-sized avatar
🏠
Working from home

Bhushan Gaikwad bhushan

🏠
Working from home
View GitHub Profile
@bhushan
bhushan / dijkstra-algorithm.js
Created June 20, 2021 07:31
Using Dijkstra algorithm find the shortest path between two nodes.
class Graph {
constructor() {
this.vertices = [];
this.adjacencyList = {};
this.dijkstraTable = {};
}
addVertex(vertex) {
this.vertices.push(vertex);
this.adjacencyList[vertex] = {};
@bhushan
bhushan / a-question-for-readers.js
Created June 5, 2021 14:32
A question for the readers?
// What will be the output of this program?
console.log("Start");
setTimeout(() => {
console.log("inside setTimeout");
}, 3000);
console.log("End");
@bhushan
bhushan / setTimeout-question.js
Created June 4, 2021 20:27
Most asked Amazon and Google Question on setTimeout
const arr = [1, 2, 3, 4];
for (var i = 0; i < arr.length; i++) {
setTimeout(function() {
console.log('Index: ' + i + ', Element: ' + arr[i]);
}, 3000);
@bhushan
bhushan / DropdownMenu
Last active March 29, 2021 12:24
Reusable Vue Components
🗃️ Dropdown Menu in Vue using Tailwind css
<template>
<div class="flex-shrink-0 relative ml-4">
<button
class="bg-white rounded-full flex focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-900"
@click="open = !open"
>
<span class="sr-only">{{ srOnly }}</span>
<slot name="menu"></slot>
@bhushan
bhushan / increaseSystemWatchers.md
Last active June 19, 2020 07:33
Increase the number of system watchers if needed

Increase the number of system watchers if needed VS Code needs to watch for file changes to work correctly. That's why the following warning may appear because our Laravel project contains a lot of files:

VS Code system watchers

To fix it, you can run the following commands in your terminal, and then restart VS Code:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
@bhushan
bhushan / .php_cs
Last active August 23, 2020 14:57
PHP CS Fixer for PHPStorm and VSCode
<?php
return PhpCsFixer\Config::create()
->setRules(array(
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => array('syntax' => 'short'),
'combine_consecutive_unsets' => true,
'method_separation' => true,
'no_multiline_whitespace_before_semicolons' => true,
@bhushan
bhushan / cloudSettings
Last active March 9, 2020 08:09
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-03-09T08:07:12.036Z","extensionVersion":"v3.4.3"}