Skip to content

Instantly share code, notes, and snippets.

use itertools::Itertools;
use nom::{
bytes::complete::take_while1,
character::complete::{i32, newline},
multi::separated_list1,
IResult,
};
use std::collections::HashMap;
fn parse_row_numbers(s: &str) -> IResult<&str, (i32, i32)> {
#![feature(let_chains)]
use nom::{
branch::alt,
bytes::complete::tag,
character::complete::{char, i32},
sequence::{delimited, separated_pair, tuple},
IResult,
};
fn parse_mul(s: &str) -> IResult<&str, (i32, i32)> {
@tomaspavlic
tomaspavlic / sorter.fsx
Created November 28, 2021 14:24
Sort photos by dates using EXIF metadata
#r "nuget: MetadataExtractor"
open System
open System.IO
open MetadataExtractor
open MetadataExtractor.Formats.Exif
module Exif =
type private Metadata = Map<string, MetadataExtractor.Directory>
@tomaspavlic
tomaspavlic / table.fs
Last active November 25, 2021 21:39
F# table
open System
open System.Data
open System.Linq
type Table<'key> when 'key: comparison =
{ columns: string list
sortedKeys: 'key seq option
map: Map<'key, double array> }
module Table =
@tomaspavlic
tomaspavlic / abput.sh
Last active June 23, 2020 08:30
Upload file or folder to Azure blob storage and shorten uploaded file with bit.ly.
#!/bin/bash
INPUT="$1"
CLEAN=$false
check_dependencies() {
for name in az curl sed tput; do
[[ $(which $name 2>/dev/null) ]] || {
echo -en "$name needs to be installed."
deps=1