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] | |
name = "testing" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
erased-serde = "0.4.3" | |
pin-project-lite = "0.2.13" |
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 { ParentProps, createContext, useContext } from "solid-js"; | |
import { SetStoreFunction, Store, createStore } from "solid-js/store"; | |
export type CacheNode = { | |
__type: string; | |
__id: string; | |
} & Record<string, unknown>; | |
const ctx = createContext<Cache>(); |
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
use std::fmt::Debug; | |
pub struct Request(String); | |
pub trait ContentType: 'static { | |
type Result; | |
// `None` if not matched. | |
fn exec(&self, req: &Request) -> Option<Self::Result>; | |
} |
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 | |
sudo apt-get update | |
sudo apt-get -y install git curl | |
sudo snap install code --classic | |
sudo snap install node --classic | |
curl https://sh.rustup.rs -sSf | sh -s -- -y |
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
pub trait Function<TMarker> { | |
type Args; | |
type Result; | |
fn exec(&self, args: Self::Args) -> Self::Result; | |
} | |
// TODO: Duplicate all the impls for `FnOnce` and `FnMut` | |
// TODO: Support up to 12 args per functions. |
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
#![allow(non_camel_case_types)] | |
#![allow(non_snake_case)] | |
#![allow(non_upper_case_globals)] | |
use std::{ops::Deref, sync::Arc}; | |
use rspc::Router as RspcRouter; | |
use worker::*; | |
mod utils { |
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
use mdns_sd::{ServiceDaemon, ServiceEvent, ServiceInfo}; | |
fn main() { | |
let mdns = ServiceDaemon::new().expect("Failed to create daemon"); | |
let service_info = ServiceInfo::new( | |
&"_demo._udp.local.", | |
&"a", | |
"192.168.1.111.local.", | |
&vec!["1.1.1.1", "2.2.2.2"][..], // "192.168.1.111", // TODO: Handle multiple addrs | |
42069, |
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
/** | |
* This file was auto-generated by openapi-typescript. | |
* Do not make direct changes to the file. | |
*/ | |
export interface paths { | |
"/pet/{petId}/uploadImage": { | |
post: operations["uploadFile"]; | |
}; | |
"/pet": { |
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 rust | |
ADD ./run.sh /run.sh | |
RUN chmod +x /run.sh | |
CMD [ "/run.sh" ] |
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
// This handler does a 301 redirect to `/test` in a loop until browser throws ERR_TOO_MANY_REDIRECTS (using wrangler@beta) | |
export const onRequest: PagesFunction<unknown> = async ({ request, env }) => { | |
// The goal of this handler is to return a static file called `test.html`. | |
// Parsing `/test.html` directly returns a URL parsing error as per issue https://github.com/cloudflare/wrangler2/issues/165 | |
const assetReq = new Request("http://fakehost/test.html", { | |
cf: request.cf, | |
}); | |
const response = await env.ASSETS.fetch(assetReq); | |
return new Response(response.body, response); |
NewerOlder