Set the path to a large file in worker.js
Run: node index.js
Then you can run this bash: while true; do date && curl -m 5 http://localhost:3000/ && echo; sleep 1; done
and open a browser http://127.0.0.1:3000/read
// Another way is to use const serializables = Symbol(); | |
const serializables = new WeakMap<object, string[]>(); | |
type Context = | |
| ClassAccessorDecoratorContext | |
| ClassGetterDecoratorContext | |
| ClassFieldDecoratorContext | |
; | |
function serialize(_target: any, context: Context): void { |
/** | |
NoInfer type | |
*/ | |
function createStreetLight<C extends string>( | |
colors: C[], | |
defaultColor?: NoInfer<C>, | |
) { | |
// ... | |
} | |
createStreetLight(["red", "yellow", "green"], "red"); // OK |
// PCI DSS standard password requirement | |
fn main() { | |
let regexp = "/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,20}$/"; | |
} |
extern crate libc; | |
use libc::c_char; | |
use std::ffi::CString; | |
use std::ffi::CStr; | |
#[no_mangle] | |
#[allow(clippy::not_unsafe_ptr_arg_deref)] | |
// Concatenates an input string with an existing string literal | |
pub extern "C" fn hello(input: *const c_char) -> *const c_char { |
const ffi = require('ffi-napi') | |
const ref = require('ref-napi') | |
const StructType = require('ref-struct-napi') | |
const ArrayType = require('ref-array-napi') | |
// Initialize the C-like array | |
const OutputArrayType = ArrayType(ref.types.int64, 2) | |
// Initialize the C-like data struct | |
const OutputType = StructType({ |
[package] | |
name = "embed" | |
version = "0.1.0" | |
authors = ["Yevhen Blotskyi <yebl@boozt.com>"] | |
edition = "2018" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
libc = "*" |
[package] | |
name = "find_exam" | |
version = "0.1.0" | |
authors = ["Ewen Blotskyi <lovecraft.crowley@gmail.com>"] | |
edition = "2018" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
serde = { version = "1.0", features = ["derive"] } |
brew install mingw-w64
rustup target add x86_64-pc-windows-gnu
.cargo/config
.cargo/config
[target.x86_64-pc-windows-gnu]
const { ApolloServer, gql } = require('apollo-server'); | |
// Type definitions define the "shape" of your data and specify | |
// which ways the data can be fetched from the GraphQL server. | |
const typeDefs = gql` | |
# Comments in GraphQL are defined with the hash (#) symbol. | |
# This "Book" type can be used in other type declarations. | |
type Book { | |
title: String! | |
author: String |