Skip to content

Instantly share code, notes, and snippets.

View baysideengineer's full-sized avatar
🛥️
what a fool believes

Sascha baysideengineer

🛥️
what a fool believes
View GitHub Profile
@baysideengineer
baysideengineer / options.md
Last active June 8, 2024 14:50
Markdown highlight options for GitHub.

Note

> [!NOTE]
> Highlights information that users should take into account, even when skimming.

Note

Highlights information that users should take into account, even when skimming.

@baysideengineer
baysideengineer / spotlight.md
Last active May 29, 2024 18:30
Reset Spotlight search on macOS.

Reset Spotlight

Run the following commands to restart and rebuild your Spotlight index on macOS.

  1. Turn indexing off.
  2. Delete Spotlight folder.
  3. Turn indexing on.
  4. Rebuild index.
@baysideengineer
baysideengineer / clone_repositories.sh
Last active June 24, 2023 11:47
Clone all repositories from GitHub and GitLab.
#!/bin/bash
# GitHub
gh repo list <organization_name> --limit 1000 | while read -r repo _; do
gh repo clone "$repo" "$repo"
done
# GitLab
glab repo clone -g <group_name> -p --paginate
@baysideengineer
baysideengineer / user-agents.json
Created June 24, 2023 11:40
List of user agents in JSON format. Thanks to @pzb.
[
{
"id": 1,
"type": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) GSA/7.0.55539 Mobile/12H143 Safari/600.1.4"
},
{
"id": 2,
"type": "Mozilla/5.0 (Linux; Android 5.0; SAMSUNG SM-N900T Build/LRX21V) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.1 Chrome/34.0.1847.76 Mobile Safari/537.36"
},
{
@baysideengineer
baysideengineer / script.sh
Created June 19, 2023 13:49
Connect to a random ExpressVPN server.
#!/bin/bash
expressvpn disconnect
expressvpn refresh
VPN=$(expressvpn list all | awk '{print $1}' | tail -n+3 | shuf -n1)
expressvpn connect "$VPN"
@baysideengineer
baysideengineer / script.sh
Created March 5, 2023 09:43
Shell script for adding an increasing ID as a first key of an object inside an JSON array.
#!/bin/zsh
FILE_PATH="data.json"
DATA=$(cat "$FILE_PATH")
REVERSE_ORDER=$(jq 'reverse' <<<"$DATA")
DATA_LENGTH=$(echo "$REVERSE_ORDER" | jq '. | length')
for ((INDEX = 0; INDEX < DATA_LENGTH; INDEX++)); do
REVERSE_ORDER=$(jq --argjson id "$INDEX" '.['"$INDEX"'] += { "id": ($id+1) }' <<<"$REVERSE_ORDER")
done