Skip to content

Instantly share code, notes, and snippets.

View ternera's full-sized avatar

ternera

View GitHub Profile
@ternera
ternera / quickDelete.js
Created March 28, 2025 13:46
Script for Wikimedia projects to quickly access the delete page
// Add delete button to pages where the user has delete permissions
(function() {
'use strict';
// Check if user has delete permissions
function hasDeletePermission() {
// Look for delete tab or link in the page
const deleteLinks = document.querySelectorAll('a[href*="action=delete"], li#ca-delete');
return deleteLinks.length > 0;
}
@ternera
ternera / Reddit Automod Rule to Remove Referral Codes.txt
Last active February 22, 2025 01:11
Reddit Automod Rule to Remove Referral Codes
type: comment
body (regex): "\b[0-9]{5}\b"
comment_repetition:
match: "regex"
pattern: "\b[0-9]{5}\b"
threshold: 2
timeframe: "14 days"
action: remove
@ternera
ternera / SetAllowedApplications.ps1
Created December 27, 2024 02:25
Only allow certain applications to run using the registry editor on Windows
# Define the allowed applications
$allowedApps = @(
"example.exe",
"example2.exe"
)
# Convert the array to a format suitable for the registry
$allowedAppsString = $allowedApps -join ','
# Registry path for the Group Policy setting
@ternera
ternera / scrape-github-emails.md
Created November 12, 2024 21:03
Scrape email addresses of contributors to any Github repository

Running the command below will show the email addresses of every contributor to a Github repository. This information is publicly accessible.

  1. Install Git on your computer.
  2. Clone a repository to your local computer.
  3. Open the terminal in the location of the repository.
  4. Run the command below (works in MacOS, Linux, Unix, etc).

git log | grep @ | cut -d' ' -f3 | tr -d '><'

Keybase proof

I hereby claim:

  • I am ternera on github.
  • I am ternera (https://keybase.io/ternera) on keybase.
  • I have a public key ASBv_9jToR0k_Zdv945DuNUVoajh2FLN4htKBRKK1r1ZrAo

To claim this, I am signing this object: