Skip to content

Instantly share code, notes, and snippets.

View murtuzaalisurti's full-sized avatar
:octocat:
breaking and fixing code

Murtuzaali Surti murtuzaalisurti

:octocat:
breaking and fixing code
View GitHub Profile
@murtuzaalisurti
murtuzaalisurti / git-aliases.md
Created July 14, 2024 14:50 — forked from colmarius/git-aliases.md
A list of useful git aliases

Intro

Bellow follows a list of aliases, split between beginner and advanced.

To start using them right away you should place the aliases you like most in a file like ~/.zsh/git. Now all that remains is to add the following line to your ~/.zshrc or ~/.bashrc:

. ~/.zsh/git # git aliases
@murtuzaalisurti
murtuzaalisurti / git-aliases.md
Created July 14, 2024 14:47 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc

Do not use forEach with async-await

TLDR: Use for...of instead of forEach in asynchronous code.

The problem

Array.prototype.forEach is not designed for asynchronous code. (It was not suitable for promises, and it is not suitable for async-await.)

For example, the following forEach loop might not do what it appears to do:

@murtuzaalisurti
murtuzaalisurti / findStyles.js
Created December 4, 2022 13:02 — forked from macbookandrew/findStyles.js
List unique CSS properties for all DOM elements
/**
* List unique CSS properties for all DOM elements
* Initially created to list unique font stacks on a page
* @see {@link http://stackoverflow.com/a/35022690/ Inspired by this StackOverflow answer}
*
* @see {@link https://gist.github.com/macbookandrew/f33dbbc0aa582d0515919dc5fb95c00a/ URL for this file}
*
* @author AndrewRMinion Design (https://andrewrminion.com)
* @version 1.1
*