Thoughts on standardizing REST with machines
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
<template> | |
<fieldset class="date-input" :data-qa-id="id"> | |
<legend>{{ legend }}</legend> | |
<component | |
@change="onChange($event)" | |
:is="component" | |
:custom-validity="customValidity" | |
v-bind="$props" | |
/> | |
</fieldset> |
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 AWS = require("aws-sdk"); | |
const fetch = require("node-fetch"); | |
const crypto = require("crypto"); | |
const slackChannel = process.env.SLACK_CHANNEL_URL; | |
const githubSecret = process.env.WEBHOOK_SECRET; | |
const verifyGitHubSignature = (req = {}, secret = "") => { | |
const sig = req.headers["X-Hub-Signature"]; | |
const hmac = crypto.createHmac("sha1", secret); | |
const digest = Buffer.from( |
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 os | |
import pickle | |
import warnings | |
import numpy as np | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
from tensorflow.keras.callbacks import EarlyStopping | |
from tensorflow.keras.layers import Dense | |
from tensorflow.keras.layers import Dropout |
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
":" //#;exec /usr/bin/env node --input-type=module - $@<$0 | |
import process from 'process' | |
const { argv } = process | |
console.log(argv) |
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 unified = require('unified') | |
const parseMarkdown = require('remark-parse') | |
const parseHtml = require('rehype-parse') | |
const remark2rehype = require('remark-rehype') | |
const rehype2remark = require('rehype-remark') | |
const rehypeStringify = require('rehype-stringify') | |
const visit = require('unist-util-visit') | |
async function go() { | |
const inputString = ` |
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
/* eslint-disable no-undef */ | |
const axios = require("axios"); | |
const { | |
STAGE: stage, | |
APPLICATION: application, | |
ENVIRONMENT: environment, | |
CONFIGURATION: configuration, | |
} = process.env; |
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
service: serverless-feature-flag | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
lambdaHashingVersion: 20201221 | |
memorySize: 128 | |
stage: ${opt:stage, 'develop'} | |
region: eu-west-1 | |
apiGateway: | |
shouldStartNameWithService: true |
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
/** @typedef {import("graphql-config").IGraphQLConfig} IGraphQLConfig */ | |
const {loadEnvConfig} = require('@next/env'); | |
loadEnvConfig(__dirname, true); | |
/** @type IGraphQLConfig */ | |
const config = { | |
schema: process.env.GRAPHCMS_ENDPOINT, | |
extensions: { |
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
type MarkUndefinable<A, B> = { | |
[K in keyof A]: A[K] extends O.Object | |
? MarkUndefinable<A[K], A.At<B, K>> | |
: K extends keyof B ? A[K] | undefined : A[K] | |
} | |
type UnionizeDeep<A extends object, B extends object> = | |
O.Merge<MarkUndefinable<A, B>, B, 'deep', M.BuiltIn, undefined> | |
type test = A.Compute<UnionizeDeep<{ |