https://gist.github.com/relaxdiego/273d511cb156d2c7d0171a0ccaa5ab2b
This file contains hidden or 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 gdnative::prelude::*; | |
use gdnative::api::NetworkedMultiplayerENet; | |
#[derive(NativeClass)] | |
#[inherit(Node)] | |
pub struct ServerPuppet { | |
address: String, | |
port: i64, | |
in_bandwidth: i64, | |
out_bandwidth: i64, |
This file contains hidden or 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::collections::{HashMap, hash_map::DefaultHasher}; | |
use std::hash::{Hash, Hasher}; | |
use std::fmt::Display; | |
fn main() { | |
let mut c: Cacher<u32, u32> = Cacher::new(|x| x); | |
let v = c.value(3); | |
println!("uncached value is: {}", v); | |
let v = c.value(3); | |
println!("cached value is: {}", v); |
This file contains hidden or 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
RUN apk --no-cache add \ | |
wget \ | |
ca-certificates \ | |
libstdc++ | |
# Get and install glibc for alpine | |
ARG APK_GLIBC_VERSION=2.29-r0 | |
ARG APK_GLIBC_FILE="glibc-${APK_GLIBC_VERSION}.apk" | |
ARG APK_GLIBC_BIN_FILE="glibc-bin-${APK_GLIBC_VERSION}.apk" | |
ARG APK_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${APK_GLIBC_VERSION}" | |
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ |