Skip to content

Instantly share code, notes, and snippets.

@cimourdain
cimourdain / README.md
Last active December 29, 2023 12:45
Create a Docker Vite Project with yarn

Create a docker vite project (with pnpm)

This document explain how to intialize and run a Vite.js project inside Docker with docker-compose.

Requirements

  • Docker

Pre-build

Create a Dockerfile from the node image:

@cimourdain
cimourdain / rust_ownership.md
Last active April 29, 2020 12:10
rust ownership usage cases table

Rust Ownership examples of usage table

Stack variable (Copy trait)

By variable

Function need to code
@cimourdain
cimourdain / main.rs
Created April 27, 2020 13:42
Rust Book - Section 8 Mean Median Mode
use std::collections::HashMap;
use std::cmp::Ordering;
fn main() {
// mean
let v = vec![1.0, 2.0, 3.0, 4.0, 5.0];
let empty_vector: Vec<f32> = Vec::new();
let negative_vector = vec![-1.0, -15.0, -30.0, -55.0];
let decimal_vector = vec![1.0, 2.0];