This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Backs up my entire website, in case Tumblr or CloudApp goes down someday. | |
# Last time I ran this, it took 18 minutes. | |
# | |
wget \ | |
--mirror `# turns on recursion and timestamping, basically says we want to "mirror" the whole site` \ | |
--convert-links `# after download, convert all links to point to localhost` \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DependencyList, Dispatch, SetStateAction, useState } from "react"; | |
/** | |
* This is like useState() but with the added feature of returning the initial | |
* value whenever the dependency list changes. This is super useful for allowing | |
* components to "reset" some internal state as a result of getting new props. | |
*/ | |
export function useResettableState<S>( | |
initial: S | (() => S), | |
deps: DependencyList, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Declare statements | |
DECLARE SUB playGame () | |
DECLARE SUB setParms () | |
DECLARE SUB clearTanks () | |
DECLARE SUB checkGround () | |
DECLARE SUB explodeTank () | |
DECLARE SUB fireShotRight () | |
DECLARE SUB fireShotLeft () | |
DECLARE SUB getInfoRight () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Stripe from "stripe"; | |
/** | |
* Utility functions for iterating objects from the Stripe API. | |
*/ | |
/** | |
* Iterates over a Stripe API list, automatically handling pagination. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "tsc-test", | |
"version": "1.0.0", | |
"description": "tsc watch problem repro", | |
"license": "ISC", | |
"scripts": { | |
"start": "tsc test.ts --watch" | |
}, | |
"dependencies": { | |
"typescript": "^5.4.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener("fetch", event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
// Our images are immutable, so we can cache them forever. | |
const ONE_YEAR = 31536000; | |
const CACHE_CONTROL = `public, max-age=${ONE_YEAR}, immutable` | |
// One way (the most efficient way) to get the raw images is to fetch them | |
// directly from the underlying Google Cloud Storage bucket. But that requires |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as BabelParser from "@babel/parser"; | |
import BabelTraverse from "@babel/traverse"; | |
import { | |
compileProgram, | |
parsePluginOptions, | |
} from "babel-plugin-react-compiler"; | |
const traverse = BabelTraverse["default"]; | |
const parse = BabelParser.parse; |
OlderNewer