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 dotenv from "dotenv"; | |
import { z } from "zod"; | |
dotenv.config(); | |
const envSchema = z.object({ | |
COUCHDB_USER: z.string().min(1), | |
COUCHDB_PASSWORD: z.string().min(1), | |
}); |
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
let releaseGlobalsPromise: null | Promise<void> = null; | |
async function acquireGlobalsLock() { | |
while (releaseGlobalsPromise) { | |
await releaseGlobalsPromise; | |
} | |
let release!: () => void; | |
releaseGlobalsPromise = new Promise( | |
(resolve) => | |
(release = () => { | |
releaseGlobalsPromise = null; |
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
for (let x = 1; x <= 100; x++) { | |
console.log( | |
`${x % 3 === 0 ? "Fizz" : ""}${x % 5 === 0 ? "Buzz" : ""}` || x.toString() | |
); | |
} |
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
#! /home/linuxbrew/.linuxbrew/opt/python@3.8/bin/python3.8 | |
import os | |
import math | |
import shutil | |
import requests | |
from xml.etree import ElementTree | |
def decimalMinuteString(decimalDegreeString, paddegrees): | |
degrees = float(decimalDegreeString) |
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 { | |
Loader | |
} = require("./designdocs/loader") | |
class CouchdbConfigurator{ | |
constructor(dbHandle){ | |
if( //duck-type check for nano db handle | |
typeof dbHandle === "object" && | |
typeof dbHandle.config === "object" && | |
dbHandle.config.url && |
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 priorities = [ | |
"!urgent", | |
null, | |
"!soon", | |
"!normal", | |
"!backlog", | |
"!wishlist", | |
] | |
function getPriorityOrder(task) { |
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 testScriptType = "map" | |
const testScriptId = "priority" | |
const priorities = [ | |
"!urgent", | |
null, | |
"!soon", | |
"!normal", | |
"!backlog", | |
"!wishlist", | |
] |
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 path = require("path") | |
const glob = require("glob") | |
const fs = require("fs") | |
const nodeEval = require("node-eval") | |
/** Helper object to construct a map of named design docs from a path containing js scripts. | |
* It populates couchdb design documents from js files targeting Spidermonkey 1.8.5 | |
* | |
* File paths like | |
* * designdocs/map/priority.js |
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
from dataclasses import dataclass | |
@dataclass | |
class Vendor: | |
pass | |
""" | |
mini45=None | |
midi45=None | |
maxi45=None |
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 pytest | |
def checkHelper(value): | |
assert list(value) == list('foo') | |
@pytest.mark.parametrize("value", ( | |
'foo', | |
'far' | |
)) | |
def testInline(value): |