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
package main | |
import ( | |
"bytes" | |
"crypto/rand" | |
"slices" | |
"testing" | |
) | |
// generateRandomByteSlice generates a random byte slice of the given size. |
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
FROM busybox:1.36.1-uclibc as busybox | |
FROM cloudflare/cloudflared:2023.8.2 | |
COPY --from=busybox /bin/sh /bin/sh | |
COPY --from=busybox /bin/cat /bin/cat | |
ENTRYPOINT [ "/bin/sh", "-c", "export TUNNEL_TOKEN=$(cat /run/secrets/tunnel_prod_token) ; cloudflared --no-autoupdate tunnel run" ] |
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
package main | |
import "encoding/base64" | |
type Base64URLBlob []byte | |
var b64 = base64.URLEncoding | |
func (b Base64URLBlob) MarshalJSON() ([]byte, error) { | |
dst := make([]byte, b64.EncodedLen(len(b))+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
import React from 'react' | |
import ReactDOM from 'react-dom/client' | |
import PocketBase from 'pocketbase' | |
type DashState = { | |
pb?: PocketBase; | |
authenticated: boolean; | |
} | |
const defaultDashState : DashState = { | |
authenticated: false, |
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 { split } from './utils'; | |
test('string split', () => { | |
const p = split("a b c d", " ", 2); | |
expect(p).toStrictEqual(["a", "b c d"]); | |
}); | |
test('string split nonexistent', () => { | |
const p = split("a b c d", ",", 2); | |
expect(p).toStrictEqual(["a b c d"]); |
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
From 5db9543bdf466a7894e5532c10618e42c162da83 Mon Sep 17 00:00:00 2001 | |
From: Josh Allmann <[email protected]> | |
Date: Fri, 24 May 2019 15:30:32 +0000 | |
Subject: [PATCH] lavfi/vf_scale_cuda: Reset frame size after acquiring from | |
hwframe. | |
The first frame is scaled correctly, and subsequent frames are | |
over-scaled / cropped since the frame data is reset with the | |
hwframe after each invocation of the scaler. |
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
# Also assumes you have the ffmpeg libs within pkg-config | |
all: | |
CPATH=/usr/local/cuda/include LIBRARY_PATH=/usr/local/cuda/lib64 go build gpu.go | |
bench: | |
CPATH=/usr/local/cuda/include LIBRARY_PATH=/usr/local/cuda/lib64 go build lpms-bench.go | |
clean: | |
rm -f gpu lpms-bench |
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
(* | |
pubsub semantics: | |
previous message is stored and sent to newly subscribing clients if present. | |
unpublishes will clear any previously stored messages | |
unsubscribes will push None to wake up any read loops | |
*) | |
type ('a, 'b) t = { | |
msg_tbl : ('a, 'b) Hashtbl.t; | |
sub_tbl : ('a, ('b option -> unit)) Hashtbl.t; |
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
module Sqlexpr = Sqlexpr_sqlite.Make(Sqlexpr_concurrency.Lwt) | |
module S = Sqlexpr | |
open Lwt.Infix | |
let test_retry_begin = | |
let __ppx_sqlexpr_shared_1 = | |
{ | |
Sqlexpr.statement = | |
{ | |
Sqlexpr.sql_statement = "SELECT COUNT(*) FROM foo"; | |
stmt_id = (Some "9e11a7554f37de62d53f51cdd7f94b6b"); |
NewerOlder