Skip to content

Instantly share code, notes, and snippets.

@Micorksen
Created March 2, 2023 19:28
Show Gist options
  • Save Micorksen/66010e54ad7004f910f822df0209dc26 to your computer and use it in GitHub Desktop.
Save Micorksen/66010e54ad7004f910f822df0209dc26 to your computer and use it in GitHub Desktop.
Delete a GitHub repository in one-click.
// ==UserScript==
// @name Git Trash
// @namespace https://micorksen.eu
// @version 1.0
// @description Delete a GitHub repository in one-click.
// @author Micorksen
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @require https://code.jquery.com/jquery-3.6.3.slim.min.js
// ==/UserScript==
'use strict'
$(function () {
$('div[data-target="get-repo.modal"] #local-panel ul').append('<li class="Box-row Box-row--hover-gray p-3 mt-0"><a class="d-flex flex-items-center color-fg-default text-bold no-underline" href="#" id="git-trash-btn"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"><path fill-rule="evenodd" d="M7.467.133a1.75 1.75 0 011.066 0l5.25 1.68A1.75 1.75 0 0115 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.7 1.7 0 01-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 011.217-1.667l5.25-1.68zm.61 1.429a.25.25 0 00-.153 0l-5.25 1.68a.25.25 0 00-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.2.2 0 00.154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.25.25 0 00-.174-.237l-5.25-1.68zM9 10.5a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.75a.75.75 0 10-1.5 0v3a.75.75 0 001.5 0v-3z"></path></svg> Delete the repository</a></li>')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment