Based on this article.
npm install --save-dev dependency-cruiser
choco install graphviz
SELECT id, column FROM table | |
where id::VARCHAR = ANY (ARRAY['b329a9b1-54fb-4d5e-853e-4c58555ab0de', 'fc666e0a-0dd1-4d02-990c-4ae52324da36']) |
import { compact, every, includes, isEmpty, map, some } from 'lodash'; | |
interface OpenAPIOperation { | |
path: string; | |
action: 'get' | 'post' | 'put' | 'delete'; | |
parameters: string[]; | |
} | |
function checkOpenApiForOps( | |
openApiJson: any, |
// Playground URL: https://www.typescriptlang.org/play?#code/KYOwrgtgBAKsDOAXKBvAUFTUCGUC8UARAIKEA0GWARvkQELmWYDGtAjBQL5prMD2IeHwA2wAHTC+AcwAUhAKLhoAa2ABPeOSgB5KgCtgzRGNUaZcJAEoxAMwCWwxMABOMmQDdL+AHxQ78ADlsAJkAyCoXD0toyx4bMBAjOwEoUEgANWxhMAQAGX9EAB4YVIAPJxAAE3hUTm8ZNIgYPgBhAXcXRAAuWEsemABtUz4bWABdAbHUJih+QWRTGoJdAyMTdXgGpWa2kA7nRGt7R0ionz9A4NDwyM9ogG4Z52BEMGcQKEWxCGwABxllOdGjt2p0hjgasNRjAxpZHtxeAIkFAnEhMtkEP0EIhJrRGuicvB8khzNi4Tw5kJRBJpHJFJAoO4soStKjEASEOSgA | |
enum Test { | |
a = "A", | |
b = "B", | |
c = 1, | |
} | |
console.log("Enum keys", Object.keys(Test).filter((v) => isNaN(Number(v)))) |
Based on this article.
npm install --save-dev dependency-cruiser
choco install graphviz
from __future__ import annotations | |
from typing import Any, Dict, List, NamedTuple, Union | |
import xml.etree.ElementTree as ET | |
class XmlNode(NamedTuple): | |
'''A helper class to make navigating xml files in python nicer and to create virtual XML nodes that can be saved''' | |
tag: str | |
attrib: Dict[str, Any] |
import ee | |
image_col = ee.ImageCollection(...) # This should work with FeatureCollections and other GEE iterables | |
img_list = image_col.toList(image_col.size()) | |
for img_idx in range(0, image_col.size().getInfo()): | |
img = ee.Image(img_list.get(img_idx)) | |
... |
/** | |
* Get a list of all upvotes urls for a user from a single page | |
* @param {string} user - The logged in username (you won't be able to get a response for another user) | |
* @param {number} pageNum - The page of upvotes to query | |
* @returns {Promise<string[]>} a list of upvoted URLs from the page | |
*/ | |
const queryUserUpvotesByPage = async (user, pageNum) => { | |
const req = await fetch(`https://news.ycombinator.com/upvoted?id=${user}&p=${pageNum}`); | |
const text = await test.text(); | |
return Array.from(text.matchAll(/titleline.*?a href\="(.*?)"/g)).map(([t, url]) => url); |
import subprocess | |
import sys | |
def run_os_cmd( | |
cmd: str, # Command to run | |
interactive_write: bool=True, # Should the command print as it's running | |
): | |
print(f"Running '{cmd}'") | |
cmd_proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True ) | |
#!/bin/bash | |
let x=0;until ((x==120)); do let x+=1;echo $x;done |