Skip to content

Instantly share code, notes, and snippets.

View simenandre's full-sized avatar

Simen A. W. Olsen simenandre

View GitHub Profile
#!/bin/bash
EXTENSIONS=(
"aaron-bond.better-comments"
"dbaeumer.jshint"
"dbaeumer.vscode-eslint"
"eamodio.gitlens"
"eg2.tslint"
"HookyQR.beautify"
swagger: '2.0'
info:
description: |
## Usage
- **Download the spec** [swagger.json](/v2/swagger.json) file, it is a [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification).
- **Generating a client** can easily be done using tools like [swagger-codegen](https://github.com/swagger-api/swagger-codegen) or other that accepts [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification) specs.
...
steps
- uses: actions/checkout@v2
...
- run: npm run build // creates dist/
- run: |
git clone --depth 1 https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/<insert-repo-name, eg. cobraz/hello>.git /<insert-repo-name>
cp -R dist/ /<insert-repo-name>/<where you want em>
cd /<insert-repo-name>
git add .
@simenandre
simenandre / create-tasks.js
Created September 9, 2020 14:10
Create Github-issues automatically with Github CLI based on `.tsx` files in `src/modules`. (Very specific)
const fs = require('fs');
const path = require('path');
const exec = require('child_process').exec;
const dir = `${__dirname}/src/modules/`
async function* walk(dir) {
for await (const d of await fs.promises.opendir(dir)) {
const entry = path.join(dir, d.name);
if (d.isDirectory()) yield* walk(entry);
else if (d.isFile()) yield entry;

Keybase proof

I hereby claim:

  • I am cobraz on github.
  • I am cobraz (https://keybase.io/cobraz) on keybase.
  • I have a public key ASAe50hudhHcHB3pCpSHqKNtKehICEifiYF6H4w7EdIpfAo

To claim this, I am signing this object:

- name: blocked
description: Work can't continue
color: b60205
- name: backlog
description: Not actively being worked on
color: ecc6ff
- name: emergent
description: Coming into being
color: ecc6ff
- name: good-first-issue
@simenandre
simenandre / 0-runtypes-openapi-clients.md
Last active September 22, 2022 02:49
Generate clients based on Runtypes (and other awesome tech) from OpenAPI

OpenAPI 👉 Typescript / Runtypes / Rest Client

  • Status: proposed (not all options are fully evaluated)
  • Date: 2021-03-29

OpenAPI (formerly Swagger) is a way to describe a REST API. It has slowly become a business standard, used by large tech companies as well as small. The Open Source community has built the OpenAPI specification to improve the reliability of REST APIs, with it you can define types and methods of an API. The community has also built tools to generate server and client code for these APIs.

The benefits of code generators are obviously having to write less code. There are many alternatives to generate clients, based on OpenAPI – most of them have issues. The issues are typically unorganized source code, being unmaintaned, outdated targets (the generated Typescript code is outdated) or being unfinished. These issues are the fundation of this proposal, which is essentially rewriting/building a OpenAPI to Typescript client generator.

Context and Problem Statement

@simenandre
simenandre / epic-template.md
Last active January 31, 2025 10:23
Issue Epic Template

Goal

Introduction

Work items

Design and specification 📔

  • Design
  • Docs plan
@simenandre
simenandre / lifecycle.md
Created September 22, 2021 19:45
Project Lifecycle

lifecycle

lifecycle

lifecycle

lifecycle

{
"openapi": "3.0.1",
"info": {
"title": "Crayon Group Customer API",
"version": "v1"
},
"servers": [{ "url": "https://api.crayon.com/api/v1" }],
"paths": {
"/ActivityLogs": {
"get": {