Skip to content

Instantly share code, notes, and snippets.

View nviennot's full-sized avatar

Nicolas Viennot nviennot

View GitHub Profile
#![cfg_attr(debug_assertions, allow(dead_code, unused_imports, unused_variables))]
use packed_simd;
use std::env;
use std::error;
use std::fs::File;
use std::io::Seek;
use std::io::SeekFrom;
use std::io;
use std::io::Write;
#![allow(dead_code)]
use std::path::PathBuf;
use std::env;
fn find_abs_lib_path(lib_name: &str) -> Result<PathBuf, &str> {
let mut search_paths = vec![];
if let Some(ld_library_path) = env::var_os("LD_LIBRARY_PATH") {
search_paths.extend(env::split_paths(&ld_library_path));
}
@nviennot
nviennot / sym.rs
Last active August 1, 2020 16:40
sym.rs
use std::collections::HashMap;
type Value = i32;
struct SymbolTable {
// We wish to own the parent SymbolTable, but we need a level of indirection
// with box, otherwise it would create an unallocatable recursive structure.
parent: Option<Box<SymbolTable>>,
values: HashMap<String, Value>,
}
@nviennot
nviennot / keybindings.json
Created November 17, 2021 17:07
vscode settings
// Place your key bindings in this file to override the defaults
[
{
"key": "cmd+enter",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus"
},
{
"key": "enter",
"command": "-renameFile",
@nviennot
nviennot / keybindings.json
Created June 27, 2022 18:22
VSCode settings
// Place your key bindings in this file to override the defaults
[
{
"key": "cmd+enter",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus"
},
{
"key": "enter",
"command": "-renameFile",