Skip to content

Instantly share code, notes, and snippets.

View benjroy's full-sized avatar

Benjamin Allen benjroy

View GitHub Profile
@pascalpoitras
pascalpoitras / config.md
Last active July 18, 2024 22:34
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@fokusferit
fokusferit / enzyme_render_diffs.md
Last active June 18, 2024 11:27
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@wldcordeiro
wldcordeiro / jest-eslint.config.js
Created May 25, 2018 02:44
Jest Multi Project Example
const { resolve } = require('path')
const root = resolve(__dirname, '..')
module.exports = {
rootDir: root,
displayName: 'eslint',
runner: 'jest-runner-eslint',
testMatch: ['<rootDir>/src/**/*.js', '<rootDir>/config/*.js'],
}
@amirhhashemi
amirhhashemi / react-polymorphic-component.tsx
Last active August 25, 2023 15:39
React polymorphic (generic, overridable) component with Typescript
/**
* Resources:
* - https://www.benmvp.com/blog/forwarding-refs-polymorphic-react-component-typescript/
* - https://react-typescript-cheatsheet.netlify.app/docs/advanced/patterns_by_usecase/#polymorphic-components-eg-with-as-props
* - https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/forward_and_create_ref/
* - https://fettblog.eu/typescript-react-generic-forward-refs/
* - https://github.com/mui/material-ui/blob/66a69ececd29cafd55ba7d52a56442771aa46b6e/packages/mui-types/index.d.ts#L94
*/
import type { ComponentPropsWithRef, ElementType } from "react"
@gtx28
gtx28 / Pimox7to8.txt
Last active July 17, 2024 09:38
Pimox7 to PVE8 upgrade
***Pi-Mox setup on raspberry pi 4b (cm4 you will need add the appropriate steps for your hw setup)
***None of this is "Prod" ready so use at your own risk, your VM's/Containers are your own responsibility. You should already have adequate backups etc.
***Raspberry PI OS setup
Install raspbian x64 lite on raspberry pi
pull the latest copy of Raspberry PI OS x64 lite based on debian 11 bullseye from here: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit
open imager, click choose os, scroll to the bottom and select custom. open the image "2023-05-03-raspios-bullseye-arm64-lite.img.xz"
@tobz
tobz / steps.md
Last active May 18, 2024 10:49
Migrate Radarr from SQLite to Postgres

Migration steps

  1. Upgrade Radarr to at least v4.1.0.6133 or newer. This brings in support for Postgres. This will also ensure that all of your SQLite tables have the latest schema migrations applied before we migrate to Postgres. If you want to upgrade further, that's fine too, but make sure you've completed all upgrades first before continuing.
  2. Create your Postgres databases (one for the "main" database and one for the "logs" database) and configure Radarr with the relevant Postgres credentials. Both databases need to be owned by/accessible from the same Postgres user.
  3. Restart Radarr, and ensure it connects to Postgres and runs all schema migrations.
  4. Once all schema migrations have been applied, and no other activity is occurring, stop Radarr.
  5. Copy the SQLite databases from the Radarr instance/pod, both the main database and logs database. For this guide, we'll assume these files are called radarr.db and logs.db.
  6. Using pg_dump -s, dump the schema for the main Radarr database . P