This file contains hidden or 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
name: compose | |
services: | |
bazarr: | |
container_name: bazarr | |
environment: | |
PGID: "1000" | |
PUID: "1000" | |
TZ: Europe/London | |
hostname: media-server | |
image: lscr.io/linuxserver/bazarr:latest |
This file contains hidden or 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
// returns an optional type of properties of T where type satisfies U | |
export type KeysOfValueType<T, U> = { | |
[K in keyof T]: T[K] extends U ? K : never | |
}[keyof T] | |
// returns an optional type of properties of T where T[prop]=string | |
export type StringsOf<T> = KeysOfValueType<T, string> | |
// example of getting only string values from an object in a generic | |
// https://github.com/microsoft/TypeScript/issues/44532 |
This file contains hidden or 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 | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
This file contains hidden or 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
type ComposableMutatorFn<T> = (t: T) => T; | |
export class ComposableMutator<T> { | |
constructor(private mutators: ComposableMutatorFn<T>[], private data?: T) { | |
this.mutators = mutators || [data => data]; | |
} | |
public addMutator(fn: ComposableMutatorFn<T>): ComposableMutator<T> { | |
return this.dupe(fn); | |
} |
This file contains hidden or 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
function factors(x: number): number[] { | |
const f = []; | |
for(let i = 2; (i*i) <= x; i++) { | |
if(x % i === 0) { | |
f.push(i); | |
} | |
} | |
return f; | |
} | |
This file contains hidden or 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
function parseGenie() { | |
var owner = $('#nowPlayingFolder').html(); | |
if (/Farrow|dave|simon_mp3|tom|Jason|Sunya/.test(owner)) { | |
$('span[onclick="rate(1);"]').click(); | |
} | |
if (/hannah|moosix|ben|Andy|Ryan|scattershot/.test(owner)) { | |
$('span[onclick="rate(-1);"]').click(); | |
setTimeout(()=> { | |
$('#btNext').click(); |
This file contains hidden or 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
function* triggerGen(res, rej) { | |
const result = yield; | |
if (result) { | |
res(result); | |
} else { | |
rej(); | |
} | |
} | |
var trigger; |
This file contains hidden or 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
Show hidden characters
{ | |
"maxerr" : 50, // {int} Maximum error before stopping | |
// Enforcing | |
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) | |
"camelcase" : false, // true: Identifiers must be in camelCase | |
"curly" : true, // true: Require {} for every new block or scope | |
"eqeqeq" : true, // true: Require triple equals (===) for comparison | |
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() | |
"immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` |
This file contains hidden or 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
{ | |
/*** Globals ***/ | |
// To ignore any custom global variables, enable the `predef` option and list | |
// your variables within it. | |
"predef": [ | |
"exports", | |
"YUITest", | |
"YUI", | |
"YUI_config", | |
"YAHOO", |
This file contains hidden or 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
function limit(num, bottom, top) { | |
if (top < bottom) {bottom = top;} | |
if (num < bottom) { | |
return bottom; | |
} | |
if (num > top) { | |
return top; | |
} | |
return num; | |
} |
NewerOlder