- Note: If any links are broken or you know of any more useful guides, please contact me with any suggestions.
- Last Updated: 2020Sep28
- Markdown and white version available here, alternative, click on "Raw".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
def deskew(im, max_skew=10): | |
height, width = im.shape | |
# Create a grayscale image and denoise it | |
im_gs = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) | |
im_gs = cv2.fastNlMeansDenoising(im_gs, h=3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const input = require('./spec3.json') | |
function titleCase(snake) { | |
return snake.replace(/(^|_)([a-z])/g, (s) => s.replace('_', '').toUpperCase()) | |
} | |
function isPrimitive(schema) { | |
switch (schema.type) { | |
case 'boolean': | |
case 'number': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FieldProps } from 'formik' | |
import React from 'react' | |
import Select, { Option, ReactSelectProps } from 'react-select' | |
export const SelectField: React.SFC<ReactSelectProps & FieldProps> = ({ | |
options, | |
field, | |
form, | |
}) => ( | |
<Select |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Examples for testing | |
# radarr_moviefile_sourcefolder="/data/torrent/movies/Justice.League.2017.1080p.HDRip.X264.AAC-m2g" radarr_moviefile_sourcepath="/data/torrent/movies/Justice.League.2017.1080p.HDRip.X264.AAC-m2g/Justice.League.2017.1080p.HDRip.X264.AAC-m2g.mkv" | |
# Instructions | |
# Put this script somewhere on your file system like /usr/local/bin and make it executable. | |
# | |
# In Radarr, Settings -> Connect add a Custom Script | |
# On Grab: No |
These steps where found here: https://apple.stackexchange.com/questions/222917/how-do-i-use-ffmpeg-to-convert-audible-files/243670#243670
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var crypto = require('crypto'); | |
fs.readFile('file.pdf', function(err, data) { | |
var checksum = generateChecksum(data); | |
console.log(checksum); | |
}); | |
function generateChecksum(str, algorithm, encoding) { | |
return crypto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Open console. | |
(Import https://raw.githubusercontent.com/MikeMcl/decimal.js/master/decimal.js first if you want/need number formatting) | |
Then copy & paste this + enter, to run this. | |
Copy console output to a NewFile.js or NewFile.jsx file. | |
prettier --write NewFile.js | |
*/ | |
/* eslint no-console: ["error", { allow: ["log"] }] */ | |
/* global document, Decimal*/ | |
(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Iterated from: https://stackoverflow.com/questions/10599933/convert-long-number-into-abbreviated-string-in-javascript-with-a-special-shortn | |
function abbreviateNumber(value) { | |
let newValue = value; | |
const suffixes = ["", "K", "M", "B","T"]; | |
let suffixNum = 0; | |
while (newValue >= 1000) { | |
newValue /= 1000; | |
suffixNum++; | |
} |