Shells that support process substitution such as bash
and zsh
allow to run shell script on gist as follows.
# With curl:
bash <(curl -sL ${GIST_URL}) args...
# With wget:
import invariant from "tiny-invariant"; | |
class AmalgoBox extends HTMLElement { | |
get input() { | |
return this.querySelector("input") as HTMLInputElement; | |
} | |
get button() { | |
return this.querySelector("button") as HTMLButtonElement; | |
} |
import * as bcrypt from "bcrypt"; | |
import { createCookieSessionStorage, redirect } from "remix"; | |
import { db } from "./db.server"; | |
export type LoginForm = { | |
username: string; | |
password: string; | |
}; |
/// <reference path="https://raw.githubusercontent.com/denoland/deployctl/main/types/deploy.fetchevent.d.ts" /> | |
/// <reference path="https://raw.githubusercontent.com/denoland/deployctl/main/types/deploy.window.d.ts" /> | |
import * as React from "https://esm.sh/react@17.0.2"; | |
import * as ReactDOMServer from "https://esm.sh/react-dom@17.0.2/server"; | |
import { createElement as h } from "https://esm.sh/react@17.0.2"; | |
// @ts-ignore VSCode occasionally complains that Deno is not defined. | |
const STRAPI_API_URL = Deno.env.get("STRAPI_API_URL") || |
Live Table: https://diafygi.github.io/webcrypto-examples/
I couldn't find anywhere that had clear examples of WebCryptoAPI, so I wrote examples and made a live table with them. Pull requests welcome!
First, take a look at the ESLint rule documentation. Just skim it for now. It's very long and boring. You can come back to it later.
ESLint rules works on the AST (Abstract Syntax Tree) representation of the code. In short, this is a tree structure that describes the code in a very verbose form. ESLint walks this tree and rules can subscribe to be notified when it hits a specific node type, like a Literal
type, which could be the "hello"
part of const welcome = "hello";
.
Go ahead and play around with some code in AST Explorer (Make sure the parser is espree
). It's a great tool!
Here are some good articles on the subject (ignore the scaffolding parts):
import { mountWithIntl } from 'helpers/intl-enzyme-test-helper.js'; | |
const wrapper = mountWithIntl( | |
<CustomComponent /> | |
); | |
expect(wrapper.state('foo')).to.equal('bar'); // OK | |
expect(wrapper.text()).to.equal('Hello World!'); // OK |