This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove .DS_Store Files | |
find . -name ".DS_Store" -type f -delete | |
# Remove AppleDouble Files | |
find . -name '._*' -exec rm {} \; | |
# Change Any Illegal Solidus Chars in Filename to Fraction Slash | |
TARGET_CHAR=$(echo -ne '\xef\x80\xa2') | |
REPLACEMENT_CHAR="⁄" | |
find . -depth -name "*$TARGET_CHAR*" -print0 | while IFS= read -r -d '' file; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html dir="ltr" translate="no"> | |
<head> | |
<title>PDF.js viewer template</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta charset="UTF-8"> | |
<!-- Necessary imports for PDF.js--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sqrt | |
# https://math.stackexchange.com/questions/127613/closest-point-on-circle-edge-from-point-outside-inside-the-circle | |
def circle_edge_point(x1, y1, x2, y2, r): | |
try: | |
cx = x1 + (r * (x2 - x1) / sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)) | |
except ZeroDivisionError: | |
# Add 0.0001 if divisor is 0 | |
cx = x1 + (r * (x2 - x1) / sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2) + 0.0001) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ..='cd ..' # Faster | |
alias cls='clear' # Faster | |
alias ll='ls -lhFA' # Better ls | |
alias vi='vim' # Use vim instead | |
alias neofetch='fastfetch' # Better neofetch | |
alias psa='ps aux | grep --color=auto' # View process(es) by name e.g. psa 'sudo find' | |
alias hs='history | grep --color=auto' # Search through command history e.g. 'git diff' | |
alias open='xdg-open' # Linux version of OSX open (Open directory in file explorer) | |
alias pbcopy='xclip -selection clipboard' # Linux version of OSX pbcopy (Copy text to clipboard) | |
alias pbpaste='xclip -selection clipboard -o' # Linux version of OSX pbpaste (Paste text from clipboard) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kali Linux | |
PROMPT=$'%F{%(#.blue.green)}┌──${debian_chroot:+($debian_chroot)─}${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))─}(%B%F{%(#.red.blue)}%n%(#.💀.㉿)%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}]\n└─%B%(#.%F{red}#.%F{blue}$)%b%F{reset} ' | |
RPROMPT=$'%(?.. %? %F{red}%B⨯%b%F{reset})%(1j. %j %F{yellow}%B⚙%b%F{reset}.)' | |
# Parrot OS | |
PROMPT="%F{red}┌[%f%F{cyan}%m%f%F{red}]─[%f%F{yellow}%D{%H:%M-%d/%m}%f%F{red}]─[%f%F{magenta}%d%f%F{red}]%f"$'\n'"%F{red}└╼%f%F{green}$USER%f%F{yellow}$%f" | |
# MacOSX | |
PS1="%n@%m %1~ %# " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List network information | |
netinfo() { | |
if [[ $(uname -s) != *"Darwin"* ]]; then | |
sudo echo -n "" | |
fi | |
echo -e "\n---------------- Network Information ----------------" | |
echo "Hostname: $(hostname)" | |
if [[ $(uname -s) == *"Darwin"* ]]; then | |
echo "Local IP: $(ipconfig getifaddr $(route -n get default | grep interface | awk '{print $2}'))" | |
echo "Network Interface: $(route -n get default | grep interface | awk '{print $2}')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Run in your browser's JS console */ | |
MeetingExiter = () => { | |
// Don't allow it to be running more than once | |
if (typeof meetingExiterMutex !== "undefined") { | |
if (meetingExiterMutex === true) { | |
console.error("Cant't run more than 1 exiter job at a time!"); | |
return; | |
} else { | |
meetingExiterMutex = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Credits to Willi Mutschler @ mutschler.dev for the update commands | |
# https://mutschler.dev/linux/pop-os-post-install/ | |
echo -e "\nThis program requires that your machine is connected to" | |
echo "a power source and that you are connected to the internet." | |
echo -e "\nTHIS PROGRAM WILL REBOOT YOUR MACHINE AFTER IT FINISHES!\n" | |
read -p "Are you connected to a power source and the internet? (Y/n): " reply |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Change the shebang above^ if need be (zsh, etc...) | |
# Must have jq & gh (GitHub CLI tool) installed | |
# Get personal access token with access to "repos" and "gists" in developer settings | |
read -p "Enter Username: " username | |
read -p "Enter Access Token: " token | |
read -p "Download Repositories? (Y/n): " getrepos | |
read -p "Download Gists? (Y/n): " getgists |
NewerOlder