Skip to content

Instantly share code, notes, and snippets.

View mattpocock's full-sized avatar

Matt Pocock mattpocock

View GitHub Profile
@mattpocock
mattpocock / total-typescript-cla.md
Created July 15, 2024 10:43
Total TypeScript CLA

Thank you for your interest in contributing to open source software projects (“Projects”) made available by egghead.io, LLC or its affiliates (“egghead.io”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to egghead.io in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact support@egghead.io.

You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

Copyright License. You hereby grant, and agree to grant, to egghead.io a non-exclusive, perpetual, irrevocable, worldwide, fully-paid, royalty-fr

Imagine a package.json that looks like this:

{
  "name": "my-package",
  "type": "module",
  "exports": {
    ".": {
      "source": "./src/index.ts",
 "import": "./dist/index.js",
// Name: Trim latest OBS video
import "@johnlindquist/kit";
import { z } from "zod";
import { getActiveEditorFilePath } from "./helpers/vscode";
const { stdout } = await $`ls -t ~/Movies/*.mp4 | head -n 1`;
const inputVideo = stdout.trim();
// Name: Trim latest OBS video
import "@johnlindquist/kit";
import { z } from "zod";
const { stdout } = await $`ls -t ~/Movies/*.mp4 | head -n 1`;
const inputVideo = stdout.trim();
const THRESH = "-40";
// Name: Trim latest OBS video
import "@johnlindquist/kit";
const { stdout } = await $`ls -t ~/Movies/*.mp4 | head -n 1`;
const inputVideo = stdout.trim();
const outputVideo = home("Movies", "trimmed", path.parse(inputVideo).base);
// Name: convert to webp
import "@johnlindquist/kit";
import * as path from "path";
const folder = await selectFolder("Select folder to convert from png to webp");
const files = await readdir(folder);
const pngFiles = files
// Name: Stop Work
// Description: It's the end of the day! Time to chill.
import "@johnlindquist/kit";
const appsToClose = [
`Slack`,
`Discord`,
`QuickTime Player`,
`Centered`,
// Name: Delete node modules
import "@johnlindquist/kit";
await $`find ~/repos -name 'node_modules' -type d -prune -exec rm -rf '{}' +`;
// Name: convert to webp
import "@johnlindquist/kit";
import * as path from "path";
const folder = await selectFolder("Select folder to convert from png to webp");
const files = await readdir(folder);
const pngFiles = files
@mattpocock
mattpocock / machine.js
Created August 3, 2021 18:35
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions