- Web Server: Play (framework) or http4s (library)
- Actors: akka
- Asynchronous Programming: monix (for tasks, reactors, observables, scheduler etc)
- Authentication: Silhouette
- Authorization: Deadbolt
- Command-line option parsing: case-app
- CSV Parsing: kantan.csv
- DB: doobie (for PostgreSQL)
| import requests | |
| import time | |
| import os | |
| import sys | |
| import openai | |
| import tiktoken | |
| from termcolor import colored | |
| openai.api_key = open(os.path.expanduser('~/.openai')).read().strip() |
| #!/bin/sh | |
| # | |
| # This is a super quick and dirty codemod for migration a codebase from Flow to TypeScript. | |
| # | |
| # Step 1: | |
| # npm i -g jscodeshift | |
| # Step 2: rename all .js files to .ts(x) | |
| # find src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; | |
| # find storybook -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; | |
| # find src/**/components -name "*.ts" -exec sh -c 'mv "$0" "${0%.ts}.tsx"' {} \; |
| // inifinite scrolling of content without extra wrappers | |
| const { render, findDOMNode } = ReactDOMFiber | |
| class App extends React.Component { | |
| render() { | |
| // wrap the root element with an Intersection Observer, exposing .observe for children | |
| return <Intersection> | |
| <div style={{ height: 200, overflow: 'auto' }}> | |
| <Page offset={0} count={10} /> | |
| </div> |
| const I = x => x | |
| const K = x => y => x | |
| const A = f => x => f (x) | |
| const T = x => f => f (x) | |
| const W = f => x => f (x) (x) | |
| const C = f => y => x => f (x) (y) | |
| const B = f => g => x => f (g (x)) | |
| const S = f => g => x => f (x) (g (x)) | |
| const S_ = f => g => x => f (g (x)) (x) | |
| const S2 = f => g => h => x => f (g (x)) (h (x)) |
Interesting part (unmounting & API) is at the end if you're not interested in the rest =).
This animation proposal is just an attempt. In case it doesn't work out, I've gathered a few examples that can test the power of a future animation system.
-
Parent is an infinitely spinning ball, and has a child ball that is also spinning. Clicking on the parent causes child to reverse spinning direction. This tests the ability of the animation system to compose animation, not in the sense of applying multiple interpolations to one or more variables passed onto the child (this should be trivial), but in the sense that the parent's constantly updating at the same time as the child, and has to ensure that it passes the animation commands correctly to it. This also tests that we can still intercept these animations (the clicking) and immediately change their configuration instead of queueing them.
-
Typing letters and let them fly in concurrently. This tests concurrency, coordination of an array of ch
| # New repository | |
| mkdir <repo> && cd <repo> | |
| git init | |
| git remote add –f <name> <url> | |
| git config core.sparsecheckout true | |
| echo some/dir/ >> .git/info/sparse-checkout | |
| echo another/sub/tree >> .git/info/sparse-checkout | |
| git pull <remote> <branch> | |
| # Existing repository |
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
