Skip to content

Instantly share code, notes, and snippets.

View KristofferRisa's full-sized avatar

Kristoffer Risa KristofferRisa

View GitHub Profile
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active November 4, 2024 04:14
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() {
@availit
availit / cloudflare-worker-force-lowercase.js
Created October 29, 2018 21:18
Cloudflare worker script to rewrite requests to lowercase, to prevent duplicate page URLs
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/**
* Fetch and log a request
* @param {Request} request
*/
async function handleRequest(request) {
let url = request.url