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
-- PostgreSQL 14 | |
SELECT | |
days AS observation_date, | |
-- Explicitly coalescing missing values to zero. | |
-- This logic will be use case-dependent. | |
coalesce(metrics.metric, 0) AS metric | |
FROM | |
-- Replace this with the dense metrics table | |
(values ('2023-01-01'::date, 111111), ('2023-06-15'::date, 222222)) AS metrics (observation_date, metric) |
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 | |
# Splits a file that contains a top-level JSON Array | |
# into individual files, one per item, named sequentially | |
# https://stedolan.github.io/jq/download/ | |
jq -c .[] "$1" | awk '{print > (NR ".json")}' |
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
/** @typedef {{name: string; title: string; description: string; sets: any[]; }} Workout */ | |
/** @typedef {{name: string; instructions: string;}} Exercise */ | |
/** @typedef {"en" | "fr" | "de" | "jp" | "zh" | "he"} Lang */ | |
/** @typedef {string | {[L in Lang]?: string}} Message */ | |
/** @typedef {{for: string, message?: Message}} ValidationResult */ | |
/** | |
* @template Entity | |
* @typedef {{(condition: {(entity: Entity): boolean}, id: string, message: Message): {(entity: Entity): ValidationResult[]}}} RuleCreator<Entity> |
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
/** | |
* A success callback for {@link ResultProvider} that receives the result from | |
* the {@link documents#probe}. | |
* @callback documents#probeResult | |
* @since 1.0 | |
* @param {documents.DocumentDescriptor} document - a sparse document descriptor with an exists | |
* property that identifies whether the document exists | |
*/ | |
/** | |
* Probes whether a document exists; takes a configuration |
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
body { | |
font-family: "Helvetica Neue", Helvetica, sans-serif; | |
font-size: 12pt; | |
line-height: 1.45; | |
padding: 0 1rem; | |
max-width: 60em; | |
} | |
a { | |
color: rgba(0, 122, 255, 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Progenitor Mock-up</title> | |
<style type="text/css"> | |
table { | |
position: relative; /* Needed for sticky headers */ | |
width: 100%; |
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 | |
# --fail: exit with 22 for an HTTP error response | |
# --show-error: write a message to stderr on failure, even with --silent | |
# --silent: don't show progress or errors | |
# -i: include headers in output | |
curl --fail --show-error --silent -i http://httpstat.us/"$1" 1>/dev/null | |
if [[ $? != 0 ]] ; then | |
echo "error" | |
exit 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
svg { | |
display: inline-block; | |
height: 90px; | |
width: 90px; | |
} | |
svg.timer { | |
transform: rotate(-90deg); | |
overflow: visible; | |
} | |
circle.gague { |
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
="FY"&IF(MONTH(G2)=1, YEAR(G2), YEAR(G2)+1) & "Q"&IF(MONTH(G2)=1, 4, FLOOR((MONTH(G2)+1)/3,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
#!/usr/bin/env bash | |
# Pipes stdin as the JavaScript body of a REST Client API eval request | |
# | |
# Usage: | |
# cat mycode.sjs | marklogic-eval.sh | |
# pbpaste | marklogic-eval.sh | |
cat <(echo 'javascript=') <(cat -) | curl http://localhost:8000/v1/eval \ | |
--digest -u admin:admin -X POST \ |
NewerOlder