Skip to content

Instantly share code, notes, and snippets.

View kheaactua's full-sized avatar

Matthew Russell kheaactua

  • Ottawa, Canada
  • 00:13 (UTC -04:00)
View GitHub Profile
@jchandra74
jchandra74 / PowerShell Customization.md
Last active June 3, 2024 21:32
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@zed
zed / format_map.py
Created November 21, 2011 23:31
''.format_map() in Python 2.x
"""''.format_map() in Python 2.x"""
try:
''.format_map({})
except AttributeError: # Python < 3.2
import string
def format_map(format_string, mapping, _format=string.Formatter().vformat):
return _format(format_string, None, mapping)
del string