Below is the Effect 4 shape I’d create for a short top-level mlink CLI.
Commands
No links prefix:
mlink health
mlink list [--q] [--status active|tombstoned|all] [--kind alias|generated|all] [--limit] [--cursor] [--all]
mlink get <slug>Below is the Effect 4 shape I’d create for a short top-level mlink CLI.
Commands
No links prefix:
mlink health
mlink list [--q] [--status active|tombstoned|all] [--kind alias|generated|all] [--limit] [--cursor] [--all]
mlink get <slug>| /* eslint-disable @typescript-eslint/no-explicit-any */ | |
| import { type TRPCQueryOptions } from '@trpc/tanstack-react-query'; | |
| import { unstable_noStore } from 'next/cache'; | |
| import { Fragment, Suspense, type ReactNode } from 'react'; | |
| import { ErrorBoundary } from 'react-error-boundary'; | |
| import { HydrateClient, prefetch as prefetchTRPC } from '@/trpc/server'; | |
| type AwaitProps<T> = | |
| | { | |
| promise: Promise<T>; |
Memoization is a somewhat fraught topic in the React world, meaning that it's easy to go wrong with it, for example, by [making memo() do nothing][memo-pitfall] by passing in children to a component. The general advice is to avoid memoization until the profiler tells you to optimize, but not all use cases are general, and even in the general use case you can find tricky nuances.
Discussing this topic requires some groundwork about the technical terms, and I'm placing these in once place so that it's easy to skim and skip over:
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| ''' | |
| This is a little script to download every song from every playlist | |
| if your Google Play Music account. Songs are organized as follows: | |
| <playlist>/<artist>/<album>/<song>.mp3 | |
| I Highly recomend putting this file in your %USER%\Music folder | |
| before running. |
| sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common | |
| sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev | |
| #Optional: so vim can be uninstalled again via `dpkg -r vim` | |
| sudo apt-get install checkinstall | |
| sudo rm -rf /usr/local/share/vim /usr/bin/vim | |
| cd ~ |
| // getComponent is a function that returns a promise for a component | |
| // It will not be called until the first mount | |
| function asyncComponent(getComponent) { | |
| return class AsyncComponent extends React.Component { | |
| static Component = null; | |
| state = { Component: AsyncComponent.Component }; | |
| componentWillMount() { | |
| if (!this.state.Component) { | |
| getComponent().then(Component => { |