Skip to content

Instantly share code, notes, and snippets.


Orta Therox orta

View GitHub Profile
orta / upload.yml
Created Feb 5, 2021
Upload GitHub Action
View upload.yml
name: Upload infra
- main
- prod
orta /
Created Jan 26, 2021
Number of html files in the TypeScript website
❯ tree packages/typescriptlang-org/public -P "*.html"
├── Handbook
│   └── index.html
├── License.html
├── Playground
│   └── index.html
├── Tutorial
│   └── index.html
orta / snowpack-plugin-assets.js
Last active Dec 6, 2020
A simple snowpack plugin for generating a .d.ts file for paths inside an asset folder
View snowpack-plugin-assets.js
// @ts-check
const fs = require("fs")
const { join, basename } = require("path")
const { format } = require("prettier")
let log = undefined
/** @type {import("snowpack").SnowpackPluginFactory} */
function plugin(_snowpackConfig, _pluginOptions) {
orta /
Created Nov 5, 2020
Orta's self review - late 2020

Core Priorities

  1. Lower the barrier of entry to adopting and understanding TypeScript. North star.

  2. Understand the TypeScript Codebase enough to provide useful API documentation and fix bugs. Validated by having a more comprehensive set of tools for people to understand how the language and tooling works.

  3. Make contributing to TypeScript easier, and reduce the amount of work maintainers need to do. Validated probably by the number of open PRs, and the number of external contributors per release.

  4. Make it easier to people wanting to build tooling around TypeScript. Validated by seeing more usage of tools like the community discord, people shipping tools with TypeScript support by default etc.

orta / prs.csv
Created Oct 13, 2020
Pull Requests per day to DefinitelyTyped
View prs.csv
2012-10-11 1
2012-10-18 3
2012-10-24 1
2012-10-25 3
2012-10-26 2
2012-10-29 3
2012-10-30 4
2012-10-31 1
2012-11-01 1
2012-11-02 3
orta /
Last active Nov 1, 2020
Yarn vs npm CLI

These are the common everyday commands used in most projects:

Installing a package deps

npm install

yarn install
orta / tsconfig-oneliners.csv
Last active Aug 24, 2020
TSConfig one-liners
View tsconfig-oneliners.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
compilerOptions,"The set of compiler options for your project","Instructs the TypeScript compiler how to compile .ts files"
allowJs,"Let TS include .JS files in imports","Allow javascript files to be compiled."
allowSyntheticDefaultImports,"Allow 'import x from y' when a module doesn't have a default export","Allow default imports from modules with no default export. This does not affect code emit, just typechecking."
allowUmdGlobalAccess,"Assume UMD imports are all globally available","Allow accessing UMD globals from modules."
allowUnreachableCode,"Error when code will never be called","Do not report errors on unreachable code."
allowUnusedLabels,"Error when accidentally creating a label","Do not report errors on unused labels."
alwaysStrict,"Ensure 'use strict' is always emitted","Parse in strict mode and emit 'use strict' for each source file. Requires TypeScript version 2.1 or later."
assumeChangesOnlyAffectDirectDependencies,"A drastically faster, but occasionally inaccurate watch mode
orta / eleventy-twoslash.ts
Created Aug 23, 2020
Eleventy Twoslash Markdown It plugin
View eleventy-twoslash.ts
import MarkdownIt from "markdown-it";
import { createShikiHighlighter, renderCodeToHTML, runTwoSlash, canHighlightLang } from "shiki-twoslash";
import { HighlighterOptions, Highlighter } from "shiki/dist/highlighter";
export default function markdownItShikiTwoslash(markdownit: MarkdownIt, userOptions: HighlighterOptions): void {
let highlighter:Highlighter = null!
// @ts-ignore - fixed in next release to always be a promise
createShikiHighlighter(userOptions).then(h => highlighter = h)
const oldFence = markdownit.renderer.rules.fence;
orta / launch.json
Created Jul 30, 2020
TS launch JSON
View launch.json
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit:
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "attach",
"name": "Attach by Process ID",
View index.html
<div id="app"></div>