Skip to content

Instantly share code, notes, and snippets.

@fbartho
fbartho / API-Generator Readme.md
Created August 2, 2019 17:50
RFC For a Props Type / Constants / JSDocs Generator for tipsi-stripe

API Generator

This is a little helper module that uses TypeScript to generate the following:

  • props-types checkers for JavaScript -- for import into the appropriate locations
  • jsdocs-style Documentation Comments -- for manual copying into the main API interface
  • String Enums for Android -- for use in extracting objects from the API Bridge
  • String Enums for iOS -- for use in extracting objects from the API Bridge
  • A TypeScript .d.ts file -- Future Feature / .gitignored for now
@fbartho
fbartho / tipsi-stripe.d.ts
Created September 5, 2020 16:05
Typings for tipsi-stripe@8.0.0
/*
* File: /src/types/tipsi-stripe/tipsi-stripe.d.ts
* Project: tr_client
* Created Date: 2019-07-18
*
* Initial Implementation: https://github.com/tipsi/tipsi-stripe/pull/384/files
* Also relevant: https://github.com/tipsi/tipsi-stripe/pull/264
*/
declare module "tipsi-stripe" {
import { Component } from "react";
@fbartho
fbartho / 1. Problem.swift
Last active April 5, 2024 22:38
Swift Structured Concurrency - Actors and Rescheduling
actor Scheduler {
var tasks: [@Sendable () async -> Void]
func schedule(task: @escaping @Sendable () async -> Void) {
tasks.append(task)
}
func executeAll() async {
while let t = tasks.popLast() {
// Tasks may schedule more tasks when they execute
await t()
// How do I defer this loop until any pending schedule operations hit my actor?
@fbartho
fbartho / 0. Synology RAID Expansion-Resync Performance.md
Last active April 29, 2024 19:02
Walkthrough of what I did to increase performance on my Synology NAS box during an expansion, and afterwards.

Performance on Synology RAIDs

(especially while expanding)

Warning: The exact commands may not match for your particular linux OS / Synology(NAS) device. I had to customize the commands after exploring my particular system's setup.

If you're new to linux, or this is a new piece of hardware / a new synology device, jump down to the section called "Inspecting a setup"

Contents