Skip to content

Instantly share code, notes, and snippets.

View pankajpatel's full-sized avatar
🎯
Focusing

Pankaj Patel pankajpatel

🎯
Focusing
View GitHub Profile
@noygal
noygal / Windows Subsystem for Linux version 1 and 2 (WSL) - node install guide.md
Last active February 21, 2024 23:17
Installing node via windows subsystem for linux

Windows 10 version 2004 - Installing Node.js on Windows Subsystem for Linux (WSL/WSL2)

UPDATE (Fall 2020): This gist is an updated version to the Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL) guide, I usually just keep here notes, configuration or short guides for personal use, it was nice to know it also helps other ppl, I hope this one too.

Windows updated windows subsystem for linux to version 2, as the F.A.Q stated you can still use WSL version 1 side by side with version 2. I'm not sure about existing WSL machines surviving the upgrade process, but as always backup and 🤞. NOTE: WSL version 1 is not replace/deprecated, and there ar

@guilhermepontes
guilhermepontes / readme.md
Last active November 27, 2022 21:02
Get the old VSCode back on macOS

Get the old VSCode icon back!! 🔥 🔥

First download the new old icon: https://cl.ly/mzTc (based on this)

You can also use the icon you want, but you need to convert it to .icns. You can use this service to convert PNG to ICNS.

Go to Applications and find VSCode, right click there and choose Get Info. Drag 'n drop the new icon.

@pahund
pahund / setup.js
Last active April 20, 2022 04:35
Using Chai and Jest assertions together with Jest's expect (thanks Ruben Oostinga!)
import chai from 'chai';
import sinonChai from 'sinon-chai';
import chaiAsPromised from 'chai-as-promised';
import chaiEnzyme from 'chai-enzyme';
chai.use(sinonChai);
chai.use(chaiAsPromised);
chai.use(chaiEnzyme());
// Make sure chai and jasmine ".not" play nice together
@staltz
staltz / .bashrc
Created March 7, 2017 13:08
Show a macOS notification when a terminal task is done
# Name it whatever you want. I like `y` because in my keyboard layout it's close to `;`
function y() {
previous=$?
if [ $previous -eq 0 ]; then
osascript -e "display notification \"Done\" with title \"Terminal Task\"" && say "it is done";
else
osascript -e "display notification \"Failed\" with title \"Terminal Task\"" && say "it went to the trees";
fi
}
@chronon
chronon / ext.txt
Created February 18, 2017 15:38
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@lyoshenka
lyoshenka / coding_maxims.md
Last active August 23, 2023 21:18
Keep this in mind
@alexweber
alexweber / buster.py
Last active October 28, 2017 08:24
hacked buster.py for my personal site
"""Ghost Buster. Static site generator for Ghost.
Usage:
buster.py setup [--gh-repo=<repo-url>] [--dir=<path>]
buster.py generate [--domain=<local-address>] [--dir=<path>] [--github-id=<github-id>]
buster.py preview [--dir=<path>]
buster.py deploy [--dir=<path>]
buster.py add-domain <domain-name> [--dir=<path>]
buster.py (-h | --help)
buster.py --version

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@pankajpatel
pankajpatel / getOverlap.js
Last active January 15, 2021 12:36
Function to get the overlap between two elements
/**
* Provides the overlapping status between two elements
* based on the passed in Element objects
*
* @param {Element, Element} Element object of DOM
* @return {Boolean} overlap status or null if native object not received
*/
const isOverlapping = (e1, e2) => {
if (e1.length && e1.length > 1) {
e1 = e1[0];