Skip to content

Instantly share code, notes, and snippets.

View beitomartinez's full-sized avatar

Roberto Martínez beitomartinez

View GitHub Profile
@reinvanoyen
reinvanoyen / terminal-prompt-git-branch-zsh.md
Last active May 11, 2024 15:42
Add Git Branch Name to Terminal Prompt (MacOS zsh)

Add Git Branch Name to Terminal Prompt (zsh)

Updated for MacOS with zsh

  • Catalina
  • Big Sur
  • Monterey
  • Ventura
  • Sonoma

screenshot

<template>
<div>
<div class="map_container" v-show="googleLoaded">
<div id="map"></div>
<input type="text" class="controls" id="pac-input"/>
</div>
<!-- <button id="btnLoad" v-show="!googleLoaded" class="btn btn-primary" v-on:click="loadMap">Load map</button> -->
<p v-show="!googleLoaded">Loading map...</p>
</div>
</template>
@jeneg
jeneg / lodashGetAlternative.js
Last active December 21, 2023 17:00
Alternative to lodash get method _.get()
function get(obj, path, def) {
var fullPath = path
.replace(/\[/g, '.')
.replace(/]/g, '')
.split('.')
.filter(Boolean);
return fullPath.every(everyFunc) ? obj : def;
function everyFunc(step) {
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active May 10, 2024 14:59
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {