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 / 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 / Storing-git-Credentials.md
Last active May 13, 2019 09:08 — forked from RichardBronosky/Storing-git-Credentials.md
[Storing git Credentials] #git #dev
@petevb
petevb / Run Visual Studio Code for Linux from WSL.md
Last active May 13, 2019 09:09 — forked from fedme/Run Visual Studio Code for Linux from WSL.md
[Run Visual Studio Code for Linux from WSL on Windows 10] #vscode #dev #wsl

Run Visual Studio Code for Linux from WSL

Thanks a lot to mredbishop and others for their insturctions posted here. This is just a recap of what they figured out.

This process was tested on WSL Ubuntu 18.04.

Install VcXsrv on Windows

  1. Dowload the VcXsrv installer from https://sourceforge.net/projects/vcxsrv/
  2. Install the software on Windows

Add VS Code repositories

@petevb
petevb / index.html
Created December 3, 2015 22:53 — forked from anonymous/index.html
JS Bin // source http://jsbin.com/lajuri
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
console.clear();