Skip to content

Instantly share code, notes, and snippets.

View nacardin's full-sized avatar

Nick Cardin nacardin

  • Atlanta, GA
  • 13:44 (UTC -04:00)
View GitHub Profile
@nacardin
nacardin / dir_is_newer.bash
Created August 10, 2021 00:04
Is dir newer
#!/bin/bash -e
src_dir=$(readlink -f $1)
dst_dir=$(readlink -f $2)
src_timestamp=$(find $src_dir -type f -printf "%T+\n" | sort | tail -1)
dst_timestamp=$(find $dst_dir -type f -printf "%T+\n" | sort | tail -1)
if [ -z $dst_timestamp ]; then
echo "$dst_dir does not exist"
elif [[ $src_timestamp > $dst_timestamp ]]; then
@nacardin
nacardin / gist:c112dff46207f13c7a9554dd766f9eca
Created April 5, 2017 18:38
HackerRank > Algorithms > Implementation > Breaking the Records
use std::io::{self, Read};
fn line_to_vec<T: std::str::FromStr>(line: &str) -> Vec<T> {
line.split_whitespace().map(|x| x.parse::<T>().ok().expect("parse error")).collect::<Vec<T>>()
}
fn main() {
let mut buffer = String::new();
io::stdin().read_to_string(&mut buffer).unwrap();
Verifying that +nickcardin is my openname (Bitcoin username). https://onename.io/nickcardin

Keybase proof

I hereby claim:

  • I am nacardin on github.
  • I am nacardin (https://keybase.io/nacardin) on keybase.
  • I have a public key whose fingerprint is 1679 D850 8629 7229 F44D D6F5 56F6 C62C A7B5 3DE0

To claim this, I am signing this object: