This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anyhow::Result; | |
use chrono::{DateTime, Local}; | |
use std::collections::VecDeque; | |
use std::fs::{metadata, read_dir}; | |
use std::iter::once; | |
use std::path::{Path, PathBuf}; | |
use std::time::SystemTime; | |
fn main() -> Result<()> { | |
let mut queue = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The MIT License (MIT) | |
Copyright (c) 2010 Richard Cook | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The MIT License (MIT) | |
Copyright (c) 2017 Richard Cook | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
macro_rules! from_map { | |
($map: ident, $obj: ident, $field: ident) => { | |
$obj.$field = $map.get(stringify!($field)).unwrap().to_string(); | |
}; | |
($map: ident, $obj: ident, $head: ident, $($tail: ident), +) => { | |
from_map!($map, $obj, $head); | |
from_map!($map, $obj, $($tail), +); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![warn(clippy::all)] | |
#![warn(clippy::cargo)] | |
//#![warn(clippy::expect_used)] | |
#![warn(clippy::nursery)] | |
//#![warn(clippy::panic_in_result_fn)] | |
#![warn(clippy::pedantic)] | |
#![allow(clippy::derive_partial_eq_without_eq)] | |
#![allow(clippy::enum_glob_use)] | |
#![allow(clippy::match_wildcard_for_single_variants)] | |
#![allow(clippy::missing_errors_doc)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn var_opt<K>(key: K) -> Result<Option<String>> | |
where | |
K: AsRef<OsStr>, | |
{ | |
use std::env::{var, VarError}; | |
match var(key) { | |
Ok(value) => Ok(Some(value)), | |
Err(VarError::NotPresent) => Ok(None), | |
_ => bail!("environment variable not found"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE RecordWildCards #-} | |
module AWSViaHaskell.AWSInfo | |
( AWSInfo(..) | |
, LoggingState(..) | |
, ServiceEndpoint(..) | |
, getAWSInfo | |
, withAWS | |
, withAWS' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[Parameter(Mandatory = $false, Position = 0, ValueFromRemainingArguments = $true)] | |
[object[]] $Arguments | |
) | |
Set-StrictMode -Version Latest | |
$ErrorActionPreference = 'Stop' | |
function Show-Usage { | |
Write-Host -Object @" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RecordWildCards #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE TypeFamilies #-} | |
module AWSViaHaskell.AWSService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dump_diffs(x, y, parts): | |
path = "/".join(parts) | |
if x is None: | |
if y is None: | |
pass | |
else: | |
print(f"{path}: x value {x} does not match y value {y}") | |
elif isinstance(x, int): | |
if isinstance(y, int): | |
if x == y: |
NewerOlder