Skip to content

Instantly share code, notes, and snippets.

import piexif # Needs to be installed
import hashlib
import argparse
import os
import sys
from pathlib import Path
import datetime
import dateutil.parser
@rbost
rbost / diff_iter_set.rs
Last active February 19, 2022 13:37
Unordered Iterators Difference (in Rust)
use core::hash::Hash;
use std::collections::{HashMap, HashSet};
/// Compute the set difference of two iterators
///
/// Takes two iterators `i` and `j`, and returns a pair of iterators `diff_i` and `diff_j` such that `diff_i` (respectively `diff_j`) contains the elements of `i` (respectively `j`) not appearing in `j` (respectively `i`).
pub fn iterator_diff_set<I, J, T>(
it_left: I,
it_right: J,
) -> (impl Iterator<Item = T>, impl Iterator<Item = T>)
@rbost
rbost / cargo_gen_doctest.sh
Created November 15, 2020 19:33
Cargo CLI invocation to keep the generated doctests
RUSTDOCFLAGS="--persist-doctests target/doctests -Z unstable-options" cargo +nightly test --doc
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Godzilla's theme
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[118]%} clean%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[081]%} u%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[118]%} +%{$reset_color%}" # ⓐ ⑃
{
"gitlens.keymap": "alternate",
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
},
"workbench.iconTheme": "vscode-icons",
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"gitlens.advanced.telemetry.enabled": false,
"C_Cpp.default.includePath": [
@rbost
rbost / .zshrc
Last active June 13, 2018 21:35
zsh configuration
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="godzilla"
# Example aliases
@rbost
rbost / .clang-format
Created December 13, 2017 19:41
Future .clang-format for OpenSSE
---
Language: Cpp
# BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
@rbost
rbost / keybase.md
Created September 1, 2016 16:53
Keybase Proof

Keybase proof

I hereby claim:

  • I am rbost on github.
  • I am rbost (https://keybase.io/rbost) on keybase.
  • I have a public key ASDXM1qEZpIhGTIfcJIHi3uOiQicXsrpoWeSG2hkt_yVmwo

To claim this, I am signing this object: