View example.ts
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
/** Action identifiers. */ | |
export const WEBHOOKS_EVENTS = [ | |
"user.created", | |
"user.updated", | |
// ... | |
] as const; | |
/** Action types. */ | |
export type WebhookEvent = typeof WEBHOOKS_EVENTS[number]; |
View example.tsx
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
import { clsx } from "clsx" | |
export function UserFieldset({ disabled, className, ...props } : React.ComponentProps<fieldset>) { | |
// fieldset has built-in disabled management for inputs and buttons inside of it. | |
return ( | |
<fieldset className={clsx("grid grid-cols-1 gap-4", className)} disabled={disabled} {...props}> | |
<div className="col-span-1"> | |
<label htmlFor="name">Name</label/> | |
<input id="name" name="name" className={clsx("input input-4 sm:input-3 input-blue", "w-full mt-1")} /> | |
</div> |
View .vscode extensions.json
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
{ | |
"recommendations": [ | |
"rome.rome", | |
] | |
} |
View gist:cd92f879bc92af698f85ad0433a953cd
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
ALTER TABLE "public"."usage_stats" | |
ALTER COLUMN "resSize" TYPE INT USING CASE WHEN "resSize" ~ '^[-+0-9]+$' THEN "resSize"::integer ELSE NULL END; |
View App.tsx
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
import React, { useReducer, useContext, Dispatch } from "react"; | |
import "./styles.css"; | |
// Local types, example: box, product, venue, etc | |
type MyItem = { | |
id: number; | |
name: string; | |
}; | |
// Reducer types |
View Dockerfile
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
## | |
# First stage: prepare image | |
FROM node:12-alpine AS base | |
ARG NPM_TOKEN | |
ARG WORKDIR=/usr/src/app | |
WORKDIR ${WORKDIR} | |
# Install container build dependencies | |
RUN apk --no-cache add g++ ca-certificates lz4-dev musl-dev openssl-dev \ | |
make python gcc zlib-dev libc-dev bsd-compat-headers py-setuptools git bash |
View gitlab-ci.yml
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
image: python:latest | |
stages: | |
- deploy | |
variables: | |
WORKON_HOME: .pipenv/venvs | |
PIP_CACHE_DIR: .pipenv/pipcache | |
cache: |
View css.json
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
{ | |
"Setup basic flexbox styling": { | |
"prefix": "flex", | |
"body": [ | |
"display: flex;", | |
"flex-direction: ${1:column};", | |
"justify-content: ${2:flex-start};", | |
"align-items: ${3:flex-start};", | |
"$0" | |
], |
View apollo-quick-client.js
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
import { ApolloClient } from "apollo-boost"; | |
import { setContext } from "apollo-link-context"; | |
import { InMemoryCache } from "apollo-cache-inmemory"; | |
export default class APIClient { | |
constructor(context = {}, options = {}) { | |
this.context = context; | |
this.options = { fetchPolicy: "no-cache", ...options }; | |
const authLink = setContext((_, context) => { | |
return { |
View hi.js
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
console.log("Hello world!"); |
NewerOlder