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
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 = '' |
(async () => { | |
const cols = 44 | |
const rows = 36 | |
const size = 90 | |
const speedX = 0.02 | |
const speedY = 0.0 | |
const loadImage = url => { | |
const img = document.createElement('img') |