Skip to content

Instantly share code, notes, and snippets.

View pinksynth's full-sized avatar

Sammy Taylor pinksynth

View GitHub Profile
@pinksynth
pinksynth / Block all album artwork in Apple Music.md
Last active August 10, 2021 15:21
Block all album artwork in Apple Music / iTunes Store (using /etc/hosts)

Block all album artwork in Apple Music / iTunes Store (using /etc/hosts)

Apple Music has some album artwork that may not be suitable for children or sensitive users. If you want to block all album artwork, use the following steps.

  1. Open the "Terminal" app (or a terminal emulator of your choice).
  2. Paste in the following command to update your /etc/hosts file to map Apple's album artwork traffic to 127.0.0.1. Once pasted in, press "Enter" to run the command. You will be asked for your computer password.
sudo -- sh -c -e "echo '# Hide Apple Music Images\n127.0.0.1    is1-ssl.mzstatic.com\n127.0.0.1    is2-ssl.mzstatic.com\n127.0.0.1    is3-ssl.mzstatic.com\n127.0.0.1    is4-ssl.mzstatic.com\n127.0.0.1    is5-ssl.mzstatic.com' >> /etc/hosts"
@pinksynth
pinksynth / get_file_type.ex
Last active April 28, 2022 03:19
Get missing file type from magic numbers in Elixir
defmodule Mix.Tasks.GetFileType do
use Mix.Task
def run([filename]) do
File.read!(filename)
|> check_magic_bytes()
|> IO.puts()
end
# Here's some basic file signatures, but you can easily add others as needed.
@pinksynth
pinksynth / ansi-colors-in-node.js
Last active September 18, 2020 16:34
ANSI Colors in Node.JS
// Dead-simple usage of ANSI colors to give Node scripts a little more elegance.
// This gist only contains a few of the many useful escape codes:
// https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
const ANSI = {
Reset: "\x1b[0m",
Bright: "\x1b[1m",
FgRed: "\x1b[31m",
FgGreen: "\x1b[32m",