curl, piping to jq if it returns JSON, echoing otherwise:
cjq() {
curl -s --show-error -o >(jq -Rsr '. as $x | try fromjson catch $x') $@
}From https://gist.github.com/carymrobbins/e2c65bb5d7e5dd23dacacc1b281f54da
| #!/usr/bin/env bun | |
| /** | |
| * Flake Test Runner | |
| * | |
| * A utility for repeatedly running potentially flaky tests to measure their reliability. | |
| * Each run is logged to a separate file, and exit codes are tracked to calculate statistics. | |
| * | |
| * Requirements: | |
| * - Bun runtime (https://bun.sh) - a fast JavaScript runtime and toolkit |
curl, piping to jq if it returns JSON, echoing otherwise:
cjq() {
curl -s --show-error -o >(jq -Rsr '. as $x | try fromjson catch $x') $@
}From https://gist.github.com/carymrobbins/e2c65bb5d7e5dd23dacacc1b281f54da
TL;DR? 👉 Implementation.
So one of the things I've liked about working with Go is that you use multiple return values a lot, with early exits that work as a kind of guard:
func GetUserFromAuth(name string, auth Auth) (error, User) {Example of FAB streaming.
curl "https://despacito.glen.workers.dev/?https://gist.githubusercontent.com/geelen/779758741e57f717a93e7bff7f2a6c5f/raw/ac8eb260f7fd2130ff5b648b91924ce1262262b0/lyrics.vtt"
| import { css } from 'styled-components' | |
| type RulesDefn = { | |
| [k: string]: string | |
| } | |
| type TrainBuilder<T extends RulesDefn> = { | |
| [k in keyof T]: TrainBuilder<T> | |
| } & { | |
| toString: () => string[] |
| const someExpensiveOperation = async x => { | |
| await new Promise(resolve => setTimeout(resolve, 1000)) | |
| return x.toUpperCase() | |
| } | |
| const PROXY_MEMO = Object.create( | |
| new Proxy( | |
| {}, | |
| { | |
| get(_, handler) { |
| type Query = { | |
| book(id: ID!): Book! | |
| author(id: ID!): Author! | |
| } | |
| type Book = { | |
| id: ID! | |
| name: String | |
| author: Author | |
| } |
| root@vps190992:~/go/bin# ./hey https://serverless-ssr.now.sh/ssr/preact | |
| Summary: | |
| Total: 14.7408 secs | |
| Slowest: 6.9887 secs | |
| Fastest: 0.2357 secs | |
| Average: 1.9901 secs | |
| Requests/sec: 13.5678 | |
| (async () => { | |
| const rows = 44 | |
| const cols = 36 | |
| const fps = 12 | |
| const gif = "http://i.imgur.com/ifR7csn.gif" | |
| const rotate = false | |
| const mirror = false | |
| const vertmirror = false | |
| document.body.innerHTML = '' |