Skip to content

Instantly share code, notes, and snippets.

View getsetbro's full-sized avatar
💭
[ bro-lite ]

Seth Broweleit getsetbro

💭
[ bro-lite ]
View GitHub Profile
@edo9k
edo9k / bookmarlets.js
Created December 16, 2020 01:30
Some of my homegrown bookmarlets.
/*
* Bookmarklets are a bit of a lost art these days,
* most people don't even know they exist anymore.
* They are lighter than any "extension", and can
* still perform really complex actions. Writing
* them is also a good way to flex your DOM/JS skills.
*/
// opens current URL on the Way Back Machine. It works on most cases.
javascript:(function(){if(document.URL === "data:text/html,chromewebdata" || document.URL === "chrome-error://chromewebdata/"){location.href='http://web.archive.org/web/*/'+loadTimeData.data_.summary.failedUrl;}else{location.href='http://web.archive.org/web/*/'+document.URL;}}())
@njgibbon
njgibbon / minimal_zshrc_0.sh
Last active January 12, 2021 17:11
Minimal .zshrc to output git branch name in prompt.
# ~/.zshrc
# Find and set branch name var if in git repository.
function git_branch_name()
{
branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}')
if [[ $branch == "" ]];
then
:
else