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 / 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
Created June 16, 2023 14: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/id_rsa
User root
# 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"
@LiamPerson
LiamPerson / Phaser3 Load Types.js
Last active March 28, 2022 07:15
All of the types that can be loaded with the loader plugin in Phaser 3
/**
* All the types that can be loaded with
* the loader plugin in Phaser 3
* grouped by settings.
*
* Referencing https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html
*/
switch(type.toUpperCase()) {
case "BINARY": // key url ...