Skip to content

Instantly share code, notes, and snippets.

View fmartins-andre's full-sized avatar

André Martins fmartins-andre

View GitHub Profile
@fmartins-andre
fmartins-andre / how-to-differ-objects-in-js.md
Created July 26, 2023 14:59
How to differ objects in JavaScript

To check what the real type of and variable, run this command:

  Object.prototype.toString.call(myVar)

It'll return something like [object Object]. The second word is the real type of the variable.

Some examples:

@fmartins-andre
fmartins-andre / git-remove-local-branches.sh
Last active December 20, 2024 13:19
Remove local branches that were merged
#!/bin/bash
echo 'Removing origins...'
git remote prune origin
BRANCHES=`git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}'`
if [[ `echo -e "$BRANCHES" | wc -w` -gt 0 ]]; then
echo 'Removing branches:'
echo $BRANCHES