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 machine = Machine({ | |
id: "formModal", | |
initial: "closed", | |
states: { | |
closed: { | |
on: { | |
OPEN: "opened" | |
} | |
}, |
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
module.exports = function (Account) { | |
Account.observe('before save', function addAccountId(ctx, next) { | |
if (!ctx.isNewInstance) { | |
debug('id is already set, returning', ctx.data); | |
return next(); | |
} | |
app.dataSources.db.connector.collection("Sequences").findAndModify({name: 'Account'}, [['_id', 'asc']], {$inc: {value: 1}}, {new: true}, function (err, rec) { | |
if (err) { | |
console.err(err); |
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
//** In web app **// | |
var current = constants.STATE_WAITING; |
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
#!/usr/bin/env bash | |
function install { | |
FILE="$2" | |
URL="$1/$FILE" | |
wget $URL -O $FILE | |
sudo gdebi $FILE | |
rm $FILE | |
} |
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
[ | |
{ | |
"type": "node", | |
"request": "attach", | |
"port": 9229, | |
"sourceMaps": true, | |
"name": "Attach 9229", | |
"cwd": "${workspaceRoot}", | |
"address": "localhost", | |
"localRoot": "${workspaceFolder}", |
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
TS2344: Type 'T[U]' does not satisfy the constraint '(...args: any) => any'. | |
Type 'T[OnlyFunctionPropertyNames<T>]' is not assignable to type '(...args: any) => any'. | |
Type 'T[T[keyof T] extends (...args: any) => any ? keyof T : never]' is not assignable to type '(...args: any) => any'. | |
Type 'T[keyof T]' is not assignable to type '(...args: any) => any'. | |
Type 'T[string] | T[number] | T[symbol]' is not assignable to type '(...args: any) => any'. | |
Type 'T[string]' is not assignable to type '(...args: any) => any'. | |
16 | T extends Composer<never>, | |
17 | U extends OnlyFunctionPropertyNames<T> = OnlyFunctionPropertyNames<T>, | |
> 18 | > = Filter<Parameters<T[U]>, Middleware<never>> |
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 RETRY_INTERVAL = 2000; | |
const MAX_RETRIES = 3; | |
const initHardwareState = "initHardware"; | |
const connectNetworkState = "connectNetwork"; | |
const provisionState = "provision"; | |
const retryState = "retry"; | |
const fatalState = "fatal"; | |
const connectedState = "connected"; |
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
#!/usr/bin/env bash | |
function mainScript() { | |
debug "Arguments: $args" | |
} | |
# Options and Usage | |
# ----------------------------------- | |
function usage() { |
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
#Reference: https://www.smarthomebeginner.com/docker-home-media-server-2018-basic | |
version: "3" | |
# https://github.com/pi-hole/docker-pi-hole/blob/master/README.md | |
services: | |
radarr: | |
image: "linuxserver/radarr" | |
dns_search: local |
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
#!/usr/bin/env bash | |
# | |
# NixOS install script synthesized from: | |
# | |
# - Erase Your Darlings (https://grahamc.com/blog/erase-your-darlings) | |
# - ZFS Datasets for NixOS (https://grahamc.com/blog/nixos-on-zfs) | |
# - NixOS Manual (https://nixos.org/nixos/manual/) | |
# | |
# It expects the name of the block device (e.g. 'sda') to partition |