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
// zod schema | |
z.object({ | |
// valid if string or: | |
optional: z.string().optional(), // field not provided, or explicitly `undefined` | |
nullable: z.string().nullable(), // field explicitly `null` | |
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined` | |
}); | |
// type | |
{ |
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
/** | |
* Semantic Versioning Comparing | |
* #see https://semver.org/ | |
* #see https://stackoverflow.com/a/65687141/456536 | |
* #see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options | |
*/ | |
function semverCompare(a, b) { | |
if (a.startsWith(b + "-")) return -1 | |
if (b.startsWith(a + "-")) return 1 | |
return a.localeCompare(b, undefined, { numeric: true, sensitivity: "case", caseFirst: "upper" }) |
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/sh | |
# To run, download the script or copy the code to a '.sh' file (for example 'fluttercleanrecursive.sh') and run like any other script: | |
# sh ./fluttercleanrecursive.sh | |
# or | |
# sudo sh fluttercleanrecursive.sh | |
echo "Flutter Clean Recursive (by jeroen-meijer on GitHub Gist)" | |
echo "Looking for projects... (may take a while)" |
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 selenium import webdriver | |
import requests | |
import bs4 | |
import os | |
# new, top, or mix url | |
top_url = "https://soundcloud.com/charts/top" | |
new_url = "https://soundcloud.com/charts/new" | |
track_url = "https://soundcloud.com/search/sounds?q=" | |
artist_url = "https://soundcloud.com/search/people?q=" |
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
#Method One: Using both Keytool and Openssl | |
keytool -export -keystore <keystore.jks> -alias <aliasName> -file publiccert.cer | |
openssl x509 -inform der -in publiccert.cer -out publiccert.pem | |
#Method Two: Direct conversion with only keytool (thanks to http://stackoverflow.com/a/6076689/552148) | |
keytool -exportcert -alias <selfsigned> -keystore <test-user.jks> -rfc -file <test-user.pem> |