Skip to content

Instantly share code, notes, and snippets.

View JoeyBurzynski's full-sized avatar
💭
Hacking away on @EdgeSEO tools.

Joey Burzynski JoeyBurzynski

💭
Hacking away on @EdgeSEO tools.
View GitHub Profile
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 6, 2024 10:42
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@JoeyBurzynski
JoeyBurzynski / Homebrew_How-to-Backup-and-Restore-Homebrew-Packages-2022.md
Last active May 2, 2024 21:24
Homebrew: How to Backup & Restore Homebrew Packages [2022, MacOS]

Homebrew: How to Backup & Restore Homebrew Packages

Homebrew makes it easy to install and keep installed software up to date on your Mac - as part of my backup routine for my Mac I want to be able to run a single command to reinstall all packages.

If you're searching on how to backup & restore Homebrew, then I assume you're here for the commands.

Brewfiles

Brewfiles are files generated with definitions that Homebrew reads and processes, a generated

@JoeyBurzynski
JoeyBurzynski / crawler-user-agent-strings-with-descriptions.txt
Created October 22, 2018 16:25
Bot & Crawler User Agents Strings with Descriptions
Googlebot/2.1 (+http://www.google.com/bot.html) # Pattern: Googlebot\/ / URL: http://www.google.com/bot.html
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) # Pattern: Googlebot\/ / URL: http://www.google.com/bot.html
Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) # Pattern: Googlebot\/ / URL: http://www.google.com/bot.html
Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/537.36 (KHTML, like Gecko) Version/8.0 Mobile/12F70 Safari/600.1.4 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) # Pattern: Googlebot\/ / URL: http://www.google.com/bot.html
Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12F70 Safari/600.1.4 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) # Pattern: Googlebot\/ / URL: http://www.google.com/bot.html
Mozilla
@JoeyBurzynski
JoeyBurzynski / Asset.sh
Created May 3, 2016 13:12
Bash Scripting: Check if a Bash Variable Has Been Set (Or Is Empty String)
# How to determine if a bash variable is empty?
# A variable in bash (and any POSIX-compatible shell) can be in one of three states:
#
# unset
# set to the empty string
# set to a non-empty string
# Most of the time you only need to know if a variable is set to a non-empty string, but occasionally it's important to distinguish between unset and set # to the empty string.
#
@JoeyBurzynski
JoeyBurzynski / cloudflare-dynamic-redirect-rule-dynamically-match-and-replace-url-path-segments-via-regexp-301.md
Created March 19, 2024 18:06
Cloudflare Dynamic Redirect Rule: Dynamically Match and Replace URL Path Segments via RegExp [301]

Dynamically Match and Replace URL Path Segments via RegExp [301]

  • Rule Name: Dynamic Redirect of Brand Locations [301]

Expression

(http.request.uri.path matches "^/locations/.*-tires-.*.asp$")
@JoeyBurzynski
JoeyBurzynski / cloudflare-dynamic-redirect-rule-enforce-trailing-slash-in-url-paths-via-301-redirect.md
Created March 19, 2024 17:53
Cloudflare Dynamic Redirect Rule: Enforce Trailing Slash in URL Paths via 301 Redirect
@JoeyBurzynski
JoeyBurzynski / cloudflare-dynamic-redirect-rule-enforce-lowercase-url-paths.md
Created March 19, 2024 17:39
Cloudflare Dynamic Redirect Rule: Enforce Lowercase URL Paths via 301 Redirect
@JoeyBurzynski
JoeyBurzynski / how-to-resolve-cloudflare-trailing-slash-308-redirect.md
Created March 19, 2024 17:05
How to Resolve Cloudflare Trailing Slash Redirect (308)

Fix Cloudflare 308 Trailing Slash Redirect Issue

Reference URLs:

Command

# Reference: https://explainshell.com/explain?cmd=find+.%2Fdist+-name+%27index.html%27+-mindepth+2+-type+f+%5C+++++-exec+sh+%5C+++++-c+%27parent%3D%22%24%28dirname+%22%241%22%29%22%3B+mv+%22%241%22+%22%24parent%2F..%2F%24%28basename+%22%24parent%22%29.html%22%3B%27+%5C+++++find-sh+%7B%7D+%5C%3B
@JoeyBurzynski
JoeyBurzynski / cloudflare-worker-ip-to-real-client-ip-address.js
Last active February 15, 2024 10:39
Resolving Cloudflare Worker IP Issues [Replace Cloudflare Worker IP with Real Client IP in X-Forwarded-For HTTP Header]
// Cloudflare Worker Sandbox Examples
// Learning here, not intended for production use.
// https://cloudflareworkers.com/#6bc84bcddcf251074b41adba568a9284:https://tutorial.cloudflareworkers.com
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
})
/**
@JoeyBurzynski
JoeyBurzynski / chatgpt-code-review-prompt.js
Last active February 13, 2024 06:48
ChatGPT Code Review Prompt: 10X Software Developer [Review, Improve and Optimize]
/**
================[ Step 1: Code Review ]================
Act as a 10X software developer.
Personal Characteristics:
You, as a 10X developer, exemplify what it means to be a true leader and innovator in the tech industry.
You're fluent in all modern stacks and are regarded as an expert in all modern programming languages, frameworks, and software engineering paradigms.
You seamlessly navigate between front-end and back-end technologies, handle databases, deployments, and even confidently manage networking and security elements.