Skip to content

Instantly share code, notes, and snippets.

diff --git a/templates/pages-template-plugin.ts b/templates/pages-template-plugin.ts
index 3b99ea2a82d18d3cbbe713af437dc53c33bd1273..971714e99d2d162fe525d7cab7c6ddf42b1bba1d 100644
--- a/templates/pages-template-plugin.ts
+++ b/templates/pages-template-plugin.ts
@@ -146,7 +146,7 @@ export default function (pluginArgs: unknown) {
if (result.done === false) {
const { handler, params, path } = result.value;
const context = {
- request: new Request(request.clone()),
+ request: request,
@russelldavis
russelldavis / outDir.md
Created January 10, 2024 21:08
tsconfig outDir notes
  • outDir can't be in a shared config dir due to microsoft/TypeScript#29172
  • It's needed even with noEmit, because tsconfig.tsbuildinfo will go there
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>591603148.251261</real>
<key>Macros</key>
@russelldavis
russelldavis / decorator.py
Last active May 2, 2020 22:07
Simplifies creation of decorators
from functools import wraps
def decorator(wrapper):
"""Simplifies creation of decorators.
Removes a layer of nesting (flat is better than nested).
Note that args and kwargs are passed in as simple positional args,
rather than unpacked *args and **kwargs. This avoids potential naming
conflicts between kwargs defined in the wrapped function and the first
arg of the wrapper (usually named "wrapped"). As a side effect, it
@russelldavis
russelldavis / debug-in-byebug-with-redirects.rb
Last active June 3, 2019 16:42
How to debug in byebug with stdin/stdout/stderr redirected
# Before calling `byebug`, run the following:
require 'io/console'
require 'byebug'
Readline.input = IO.console
Readline.output = IO.console
Byebug::Context.interface.instance_variable_set('@input', IO.console)
Byebug::Context.interface.instance_variable_set('@output', IO.console)
Byebug::Context.interface.instance_variable_set('@error', IO.console)
# This used to be built in to byebug (https://github.com/deivid-rodriguez/byebug/pull/211)
@russelldavis
russelldavis / git-rev-run.sh
Created November 18, 2015 01:13
Run a given command over a range of git revisions
#!/bin/bash
#
# This script runs a given command over a range of Git revisions. Note that it
# will check past revisions out! Exercise caution if there are important
# untracked files in your working tree.
#
# This is adapted from Gary Bernhardt's dotfiles:
# https://github.com/garybernhardt/dotfiles
#
# Example usage:
@russelldavis
russelldavis / git-co.sh
Created April 29, 2014 23:07
A better git-checkout
#!/bin/bash
#####
# Fix the ridiculous ambiguity between branches and files in git-checkout.
# The new default behavior is to check out branches only.
# To check out a file, you must precede the filename with "--".
#####
found=false
for arg in "$@"; do
if [[ $arg == "--" ]]; then
@russelldavis
russelldavis / otask.sh
Created March 27, 2014 23:33
Helpers for creating maniphest tasks (requires https://github.com/bloomberg/phabricator-tools)
#!/bin/bash
exec arcyon task-create "$@" -p normal --format-url --projects Product $PROJ | tee >(pbcopy)

Please publicly post the following Gist, and name it keybase.md:

Keybase proof

I hereby claim:

  • I am russelldavis on github.
  • I am russell (https://keybase.io/russell) on keybase.
  • I have a public key whose fingerprint is 1FD0 A33F 28EF 63E0 C007 1661 2A16 F6C3 DC27 6AAC
@russelldavis
russelldavis / git-up.sh
Last active December 20, 2015 20:09
Pulls in updates from the remote tracking branch of the specified branch (defaults to current branch), rebasing them on top of the current branch and preserving merge commits.
#!/bin/bash
set -e
orig_head=$(git rp HEAD)
branch=${1:-$(git rev-parse --abbrev-ref HEAD)}
remote=$(git config "branch.$branch.remote")
tracking_branch=$(git rev-parse --abbrev-ref --symbolic-full-name $branch@{u})
git fetch $remote
git rebase --preserve-merges $tracking_branch