Skip to content

Instantly share code, notes, and snippets.

View LiamPerson's full-sized avatar
⌨️
AI, Blockchain, Decentralization, Power to the People!

LiamPerson

⌨️
AI, Blockchain, Decentralization, Power to the People!
  • Australia
View GitHub Profile
@LiamPerson
LiamPerson / pi_mount_usb.md
Created June 15, 2024 13:39 — forked from etes/pi_mount_usb.md
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following

@LiamPerson
LiamPerson / audio_genres.json
Created August 23, 2023 15:09
My descriptions for various music genres.
[
{ "name": "Unknown", "description": "For music that has no genre assigned." },
{ "name": "Alternative rock", "description": "Calmer variant of rock. Has a focus on vibes." },
{ "name": "Ambient", "description": "Music that can easily fade into the background. Calming stuff!" },
{
"name": "Breakbeat",
"description": "A genre of electronic music characterized by the use of breaks, often sampled from earlier recordings in funk, jazz, and R&B, for the main rhythm."
},
{ "name": "Chillstep", "description": "A subgenre of dubstep that focuses on a more melodic and relaxing sound." },
{ "name": "Classical", "description": "Lots of traditional instruments, and a focus on the melody." },
@LiamPerson
LiamPerson / Precommits with NextJS.md
Last active July 19, 2023 14:54
How I set up precommits with my nextjs projects to support linting and prettifying my staged files.

Automatic linting + prettifying staged files

Note that this only works for NextJS projects

  • (needed for good eslinting) Add a .eslintrc.json file to the root of your project with the following contents:
{
  "extends": "next/core-web-vitals"
}
  • (optional prettier config) Add a .prettierrc file to the root of your project with the following contents:
@LiamPerson
LiamPerson / yt-dlp.conf
Created June 16, 2023 14:59
My yt-dlp config
--ignore-errors
# --no-playlist
# Save in ~/Videos
-o D:/Videos/YTDL/%(title)s_%(resolution)s_%(fps)s.%(ext)s --restrict-filenames
# Prefer 1080p or lower resolutions
-f bestvideo[ext=mp4][height<1200]+bestaudio[ext=m4a]/bestvideo[ext=webm][height<1200]+bestaudio[ext=webm]/bestvideo[height<1200]+bestaudio/best[height<1200]/best
@LiamPerson
LiamPerson / config
Last active June 30, 2024 00:52
My ssh config
# Default
IdentityFile ~/.ssh/id_rsa
# For Master Server @ Vultr
Host mastervultr xxx.xxx.xxx.xxx
HostName xxx.xxx.xxx.xxx
IdentityFile ~/.ssh/mastervultr/YOUR_ID_FILE
User PUT_USER_HERE
# For Raspberri Pi GIT Server @ Home
@LiamPerson
LiamPerson / .gitconfig
Last active June 16, 2023 14:58
My personal git config.
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[core]
ignorecase = false
[alias]
find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'"
show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'"
@LiamPerson
LiamPerson / Color.ts
Created March 12, 2023 06:55
Color name inference class made for Typescript. Converts any {r: number, g: number, b: number} to a name defined by BASE_COLORS
export type RGBColor = {
r: number;
g: number;
b: number;
}
class Color {
/**
* Available color names to be used in the `asName` method
*/
@LiamPerson
LiamPerson / generateStripes.js
Last active November 4, 2022 05:53
Generate a css striped background using javascript.
/**
* Generates a linear-gradient css function to use with the css background property to display a stripes.
* @param {String} col1 the first colour.
* @param {String} col2 the second colour.
* @param {String} angle what angle the chevron should appear at
* @param {Number} iterations how many stripes you want. 7 = 4 col1, 3 col2
* @returns {String}
* @example generateStripes("rgba(255, 255, 255, .2)", "white", "-45deg", 40) // returns "linear-gradient(-45deg,rgba(255, 255, 255, .2) 16.666666666666668%,rgba(255, 255, 255, .2) 16.666666666666668%, rgba(255, 255, 255, .2) 33.333333333333336% ,white 33.333333333333336%, white 50% ,rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 66.66666666666667% ,white 66.66666666666667%, white 83.33333333333334% ,rgba(255, 255, 255, .2) 83.33333333333334%, rgba(255, 255, 255, .2) 100% )"
*/
export const generateStripes = (col1, col2, angle, iterations) => {
@LiamPerson
LiamPerson / badwords_243705
Last active May 23, 2022 13:04
243,705 words that maybe shouldn't be in usernames.
This file has been truncated, but you can view the full file.
!!v*$3x
!!v*5ex
!!v*sex
!!v3$3x
!!v3sex
!!v3zex
!!ve$ex
!!ve53x
!!ve5ex
!!ves*x
@LiamPerson
LiamPerson / Phaser 3 Loader Plugin Types Normal Case.txt
Created April 26, 2022 09:12
Phaser 3's loadable files in the case of their method name.
"binary"
"css"
"html"
"script"
"sceneFile"
"text"
"tilemapCSV"
"tilemapImpact"
"tilemapTiledJSON"
"xml"