Skip to content

Instantly share code, notes, and snippets.

@unrevised6419
unrevised6419 / GONE.md
Last active November 4, 2021 09:18
Git alias to remove all local branches that are gone on remote

Create alias manually in ~/.gitconfig file (recommened):

[alias]
	gone = "!f() { git fetch --all --prune; git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D; }; f"

Create alias (problematic):

@unrevised6419
unrevised6419 / git-reset-author.sh
Last active December 1, 2021 15:52
Change commit author using a rebase
git rebase -x "git commit --amend --reset-author --no-edit" main
@unrevised6419
unrevised6419 / README.md
Last active June 7, 2025 07:57
Instant Markdown editor

Instant Markdown editor in new tab

  1. Create a new bookmark
  2. To the link add data:text/html,
  3. After data:text/html, paste block below
  4. Save bookmark, and open it

First time it may take a while to load the library

@unrevised6419
unrevised6419 / README.md
Last active September 5, 2023 21:16
curs.md google function
@unrevised6419
unrevised6419 / youtube-dl.md
Last active April 13, 2025 14:45
ringtone youtube audio
$$('.runtimeLabel')
.map(e => e.textContent.trim().replace('Length: ',''))
.map(text => {
const hasHours = text.includes('and')
const [hText, mText] = hasHours
? text.split(' and ')
: ['0 hrs', text]
const h = Number.parseInt(hText)
const m = Number.parseInt(mText)
return h * 60 + m
@unrevised6419
unrevised6419 / YouTube-Watch-Later-Time.js
Created January 11, 2024 10:50
YouTube Watch Later Time
$$('ytd-playlist-video-renderer .style-scope ytd-thumbnail-overlay-time-status-renderer')
.map(e => e.textContent.trim().split(':').reverse())
.map(([s = '0', m = '0', h = '0']) => ({ s: parseInt(s), m: parseInt(m), h: parseInt(h) }))
.map(({ s, m, h }) => s + m * 60 + h * 3600)
.reduce((a, b) => a + b) / 3600
@unrevised6419
unrevised6419 / remove-twitter.md
Created February 12, 2024 20:01
Remove Twitter

Get rid of all content from Twitter

How to use "Remove Tweets"

  1. Sign in to Twitter
  2. Go to your Profile
  3. Open DevTools and go to the 'Console' tab
  4. Copy and paste the following script
const cacheControlDirective = new GraphQLDirective({
name: 'cacheControl',
locations: [
DirectiveLocation.FIELD_DEFINITION,
DirectiveLocation.OBJECT,
DirectiveLocation.INTERFACE,
DirectiveLocation.UNION,
],
args: {
maxAge: {
@unrevised6419
unrevised6419 / portal-provider.ts
Created November 19, 2024 11:49
Vue Portal Provider that nests/recurse
import {
inject,
provide,
type InjectionKey,
type SlotsType,
type ComputedRef,
computed,
toRef,
defineComponent,
} from 'vue';