Skip to content

Instantly share code, notes, and snippets.

@hyperupcall
hyperupcall / settings.jsonc
Last active March 31, 2024 22:52
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@thatrand0mnpc
thatrand0mnpc / custom_traceback_example.py
Last active August 1, 2022 21:22
Python custom traceback
import linecache
import re
import sys
from types import TracebackType
from typing import Any, Dict, List, Optional
PACKAGE_PATH_PATTERN = r'.*/lib/python.*/site-packages/.*'
class TracebackLogger:
#!/usr/bin/env python
"""Extend Python's built in HTTP server to save files
curl or wget can be used to send files with options similar to the following
curl -X PUT --upload-file somefile.txt http://localhost:8000
wget -O- --method=PUT --body-file=somefile.txt http://localhost:8000/somefile.txt
__Note__: curl automatically appends the filename onto the end of the URL so
@david-mcdonagh
david-mcdonagh / aws-kms-client.go
Last active November 22, 2023 11:30
Go client to search KMS Keys in multiple profiles and mark keys that have tag ResourceIdentifier for deletion 'go run wd-aws-client.go <--dry-mode (optional> <profile_name> ...
package main
import (
"context"
"fmt"
"log"
"os"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
@bmatthewshea
bmatthewshea / certbot_pip_install-debian_ubuntu.md
Last active April 18, 2024 16:40
Debian/Ubuntu - CERTBOT without SNAP/SNAPD

CERTBOT - Install using Python PIP

Install Certbot using Python PIP (Package Installer for Python) - without using SNAP, APT or SYSTEMD. (Debian/Ubuntu)


This guide will help you install LetsEncrypt / Certbot using venv PIP under Debian/Ubuntu.

  • This guide has been tested up to Debian 12 / Bookworm.
@jerieljan
jerieljan / btt-screenshot.sh
Created May 22, 2021 13:32
Screenshot OCR with BetterTouchTool on MacOS
#!/usr/bin/env bash
# Usage:
# - Install `tesseract` with `brew install tesseract`
# - In BetterTouchTool, create a trigger of your choice.
# (I recommend a Keyboard Shortcut with Cmd+Shift 6)
# - Add an Execute Shell Script / Task action
# - Paste this script.
# NOTE: You'll need to authorize BTT to the Screen Recording permission in Security and Privacy at System Preferences
@tonetheman
tonetheman / find_radio.py
Created September 27, 2020 15:15
find a radio button to click on
URI = "https://www.16personalities.com/free-personality-test"
from selenium.webdriver import Chrome, ChromeOptions
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
@dnanto
dnanto / geomid.R
Created June 25, 2020 18:14
Calculate the geographic midpoint given a list of geographic coordinates in R.
library(tidyverse)
geomid <- function(lat, lon)
{
# http://www.geomidpoint.com/calculation.html
lat <- lat * pi / 180
lon <- lon * pi / 180
x <- mean(sum(cos(lat) * cos(lon)))
y <- mean(sum(cos(lat) * sin(lon)))
z <- mean(sum(sin(lat)))
@kix2mix2
kix2mix2 / kcng.py
Created January 27, 2020 16:53
K-Nearest Center of Gravity Graph (KNCG)
def get_kncg(df, K=4):
# df is a pandas dataframe with mandatory columns ['x','y']
graph = get_knntree(df, 1)
for node_a, row in df.iterrows():
if node_a % KK_prints == 0:
print(K)
node_a_coord = list(row[:2])
ncns = []
@skeeto
skeeto / README.md
Last active August 29, 2021 22:22
quniq