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
// On first access looks up a search param: `?token=...` | |
// If the token is valid, saves it in cookies so that | |
// subsequent requests don't need the search param. | |
import type { Config, Context } from "@netlify/edge-functions"; | |
// Ideally look up from the environment | |
const EXPECTED_TOKEN = "very-secret"; | |
const TOKEN_COOKIE_NAME = "my-token"; | |
const TOKEN_HEADER_NAME = "x-my-token"; |
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 type { Config, Context } from "@netlify/edge-functions"; | |
// https://datatracker.ietf.org/doc/html/rfc7617 | |
// base64 encoded "user:pass" | |
const USER_PASS_ENCODED = "dXNlcjpwYXNz"; | |
export default async (request: Request, context: Context) => { | |
const requestAuthentication = () => { | |
const response = new Response(null, { | |
status: 401, |
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
# MIT License, see below | |
# | |
# These are some helpers for figuring out the derivations attributes of runtime | |
# dependencies of a derivation, in particular the function `runtimeReport`. At | |
# the bottom of the file you can see it used on `hello`. Spoiler: glibc is a | |
# runtime dependency. | |
# For more info see | |
# | |
# https://nmattia.com/posts/2019-10-08-runtime-dependencies.html |
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
let | |
# Use pinned packages | |
_nixpkgs = import <nixpkgs> {}; | |
nixpkgs = _nixpkgs.fetchFromGitHub | |
({ | |
owner = "nmattia"; | |
repo = "nixpkgs"; | |
rev = "02359c639193103812f7356564326556cbb41ca4"; | |
sha256= "1rg0czkxqynycw23v0dmk0vd2v17d6v3yr06bg23wqwpm3b5z0nd"; | |
}); |
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 { TemplateResult } from "lit-html"; | |
type Render = (tpl: TemplateResult) => void; | |
type Step<In, Out> = { | |
template: (args: { | |
next: (arg: Out) => void; | |
state: In; | |
back?: () => void; | |
}) => TemplateResult; |
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
diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr | |
index deadbeef..deadbeef 100644 | |
--- a/gcc/config/avr/t-avr 2023-01-03 21:56:23 | |
+++ b/gcc/config/avr/t-avr 2023-01-03 21:56:32 | |
@@ -91,9 +91,6 @@ | |
$(srcdir)/config/avr/avr-arch.h $(TM_H) | |
$(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $< -o $@ $(INCLUDES) | |
-$(srcdir)/doc/avr-mmcu.texi: gen-avr-mmcu-texi$(build_exeext) | |
- $(RUN_GEN) ./$< > $@ |
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
res=$(nix-build --no-link ./default.nix -A load) | |
watch_file ./default.nix | |
. "$res" |
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
let clientX_0 = 0; | |
let clientX_d = 0; | |
const MIN_WIDTH = 10; | |
const MIN_HEIGHT = 10; | |
let w0 = getpc("inner-width"); | |
let h0 = getpc("inner-height"); | |
let w = w0; |
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
#!/usr/bin/env bash | |
set -e | |
the_pattern=$1 | |
# We need to export because xargs runs in a subshell | |
export the_file=$2 | |
if [ -z "${the_pattern}" ]; then | |
echo pattern missing |
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
# Store the nix-created `dist` in `localSrc/.nix-cache` after build (whether | |
# successful or not) and re-injects it for subsequent builds. | |
# | |
# `./mask` should contain a haskell project with an `out.nix` file. That file | |
# should describe a typical cabal derivation with the extra field: | |
# | |
# preUnpack = '' | |
# localSrc=${toString ./.} | |
# ''; | |
# |
NewerOlder