Skip to content

Instantly share code, notes, and snippets.

@petevb
petevb / Bash Prompt with Git Status Info
Created November 19, 2021 12:12 — forked from sundeepgupta/Bash Prompt with Git Status Info
Bash Prompt with Git Status Info
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@petevb
petevb / blog.md
Created September 27, 2021 16:31
test

‎‎​

@petevb
petevb / launch.json
Last active May 17, 2021 20:56
Attach debugger in VS Code for WSL
{
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "publish",
"program": "${workspaceFolder}/bin/Debug/net5.0/sample1.dll",
"args": [],
"cwd": "${workspaceFolder}",
@petevb
petevb / .gitignore
Last active July 29, 2020 12:55
Create Azure Environment in bash with az CLI
_oauth-permissions.json
_disable-oauth-permissions.json
@petevb
petevb / ETagMiddleware.cs
Last active July 21, 2020 09:40 — forked from madskristensen/ETagMiddleware.cs
ASP.NET Core ETAg middleware
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Net.Http.Headers;
using System.IO;
using System.Security.Cryptography;
using System.Threading.Tasks;
public class ETagMiddleware
{
@petevb
petevb / diagrams.md
Created March 27, 2020 11:41 — forked from blackcater/diagrams.md
Markdown Diagrams

Diagrams

Markdown Preview Enhanced supports rendering flow charts, sequence diagrams, mermaid, PlantUML, WaveDrom, GraphViz, Vega & Vega-lite, Ditaa diagrams. You can also render TikZ, Python Matplotlib, Plotly and all sorts of other graphs and diagrams by using Code Chunk.

Please note that some diagrams don't work well with file exports such as PDF, pandoc, etc.

Flow Charts

This feature is powered by flowchart.js.

@petevb
petevb / AddExtensionToWindowsExplorerPreview.ps1
Last active January 13, 2020 13:03
Enable text preview pane for a given extension in Windows Explorer.
#############################################################################
# This script will enable preview for a given extension in Windows Explorer.
# Based on original by Bhargav Shukla http://www.bhargavs.com
#
# DISCLAIMER
# ==========
# THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE
# RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
#############################################################################
param (
@petevb
petevb / .bash-aliases
Last active May 18, 2023 09:52
[dotfiles] copy to `%userprofile%`
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# twotime: https://www.npmjs.com/package/twotime
@petevb
petevb / README.md
Last active March 12, 2023 21:14
[Boxstarter] From clean machine to all the things installed.