Outils pour utilisateurs

Outils du site


blog

Notes conversion JSON YAML

Voir :

Voir aussi :

# Source - https://stackoverflow.com/a/60585911
# Posted by Richard Gomes, modified by community. See post 'Timeline' for change history
# Retrieved 2026-11-13, License - CC BY-SA 4.0
 
function yaml_validate {
  python -c 'import sys, yaml, json; yaml.safe_load(sys.stdin.read())'
}
 
function yaml2json {
  python -c 'import sys, yaml, json; print(json.dumps(yaml.safe_load(sys.stdin.read())))'
}
 
function yaml2json_pretty {
  python -c 'import sys, yaml, json; print(json.dumps(yaml.safe_load(sys.stdin.read()), indent=2, sort_keys=False))'
}
 
function json_validate {
  python -c 'import sys, yaml, json; json.loads(sys.stdin.read())'
}
 
function json2yaml {
  python -c 'import sys, yaml, json; print(yaml.dump(json.loads(sys.stdin.read())))'
}

FIXME

2026/11/13 11:16 · Jean-Baptiste

Git commit perdu

git reflog
git checkout dev
git checkout 5559d8a .
# git reset --hard 5559d8a

FIXME

2026/11/12 18:16 · Jean-Baptiste

Notes mojo lang

Voir :

uv pip install mojo

hello.mojo

def main():
    print("Hello world !") 
mojo format hello.mojo
mojo run hello.mojo
mojo build hello.mojo
2026/11/11 20:34 · Jean-Baptiste

Notes rust lang compilation

Voir :

sudo apt-get install cargo
cargo new hello-world
 
cd hello-world/

src/main.rs

fn main() {
    println!("Hello, world!");
}

Compilation

Compilation basique

rustc src/main.rs

Compilation statique

sudo apt-get install librust-rustup-dev rustup
rustup default stable
rustup target add x86_64-unknown-linux-musl
cargo build --target=x86_64-unknown-linux-musl
$ ldd ./target/x86_64-unknown-linux-musl/debug/hello-world
        statically linked

Compilation 32bits pour windows

rustup target add i686-pc-windows-gnu
cargo build --target=i686-pc-windows-gnu
# cargo build  --release --target=i686-pc-windows-gnu
wine target/i686-pc-windows-gnu/debug/hello-world.exe

Compilation 32bits statique pour GNU/Linux

rustup target add i686-unknown-linux-musl
cargo build --target i686-unknown-linux-musl
2026/11/11 18:35 · Jean-Baptiste
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki