vTrimString-> validate it's a non-empty string after trimming for whitespacevTrimStringOptional-> same as above, but allowingundefined. Converts empty strings (after trimming) toundefinedvAfter-> validate it's a base64 encoded JSON object + matches the given schema. Useful for encoded pagination variables, such as?after={id: 10}vCoerceObject-> coerce values from string to whatever the provided schema needs. Useful for parsing query strings, path params, etc.
This file contains hidden or 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
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Running; | |
| using System.Numerics; | |
| using System.Runtime.CompilerServices; | |
| using System.Runtime.InteropServices; | |
| using System.Runtime.Intrinsics; | |
| BenchmarkRunner.Run<Benchmarks>(); | |
| [MemoryDiagnoser] | |
| public class Benchmarks |
This gist represents an API construct on top of API Gateway V2. It's designed to make it easy to add lots of protected endpoints to a serverless API.
It introduces the following opinions:
- Sandbox environments exist in the same AWS account as "dev"
- There are only dev and production accounts - no test account
- Dev and prod have static DNS records, but sandbox DNS records are dynamically generated by AWS
- All API endpoints are authenticated by default. You opt out rather than in to authentication
- All endpoints are either one verb only or all HTTP verbs. You cannot have a handler for only
GETandPOSTbut notPUT, for example. Instead, you must create separate endpoints for each verb (unless you useANY, in which case your lambda will be triggered for all HTTP verbs on that endpoint)
This file contains hidden or 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
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any | |
| means. | |
| In jurisdictions that recognize copyright laws, the author or authors | |
| of this software dedicate any and all copyright interest in the | |
| software to the public domain. We make this dedication for the benefit |
This file contains hidden or 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 { forwardRef, Box, BoxProps, Icon, IconProps } from "@chakra-ui/react"; | |
| import React, { FC, ReactText } from "react"; | |
| export interface BlobProps { | |
| fill: string; | |
| cx: ReactText; | |
| cy: ReactText; | |
| r?: ReactText; | |
| } |
This file contains hidden or 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 HOME_HOST = 'home' | |
| /** @param {NS} ns */ | |
| export async function main(ns) { | |
| ns.disableLog("ALL") | |
| while (true) { | |
| const hosts = getAllHosts(ns) | |
| const targets = ['foodnstuff'] |
curl https://gist.githubusercontent.com/MarkSFrancis/c571d5f1003eb630ac3d142cb26f9805/raw/filename | bashAdd to your alias to allow easily running a script from bash:
# Usage: gist convert-audio
alias gist='function _gist(){ curl -S -s "https://gist.githubusercontent.com/MarkSFrancis/c571d5f1003eb630ac3d142cb26f9805/raw/$1.sh" | bash -s "${@:2}"; };_gist'NewerOlder