Skip to content

Instantly share code, notes, and snippets.

View matbesancon's full-sized avatar

Mathieu Besançon matbesancon

View GitHub Profile
@matbesancon
matbesancon / Pair.java
Last active May 13, 2019 09:25
A simple pair class
public final class Pair<L, R> {
private L _left;
private R _right;
public Pair(L left, R right) {
this._left = left;
this._right = right;
}
public L left() {
@matbesancon
matbesancon / main.rs
Created August 23, 2018 14:27
Rust UUID minimal example to test result consistency
extern crate uuid;
use uuid::Uuid;
fn main() {
let refs = vec![&uuid::NAMESPACE_DNS, &uuid::NAMESPACE_OID, &uuid::NAMESPACE_URL, &uuid::NAMESPACE_X500];
let tags = vec!["NAMESPACE_DNS", "NAMESPACE_OID", "NAMESPACE_URL", "NAMESPACE_X500"];
let pairs = refs
.iter()
.zip(tags.iter())
.map(|(u,t)|
@matbesancon
matbesancon / config.fish
Last active January 17, 2021 18:46
micro editor config
# file ~/.config/fish/config.fish
# Based on clearance
# name: clearance
# ---------------
# Based on idan. Display the following bits on the left:
# - Current directory name
# - Git branch and dirty state (if inside a git repo)
function _git_branch_name
echo (command git symbolic-ref HEAD 2> /dev/null | sed -e 's|^refs/heads/||')