This file contains hidden or 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
#!/usr/bin/env python3 | |
import random | |
import sys | |
def print_usage(): | |
print("random-redact.py <RAND_THRESH> [INPUT]") | |
print() | |
print("Randomly replace words in the input with full block characters, giving the appearance") | |
print("that they have been redacted") |
This file contains hidden or 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 image::Rgb; | |
struct Hsv([f32; 3]); | |
fn convert_rgb_to_hsv(pixel: &Rgb<u8>) -> Hsv { | |
let [r, g, b] = pixel.0; | |
let big_m = *[r, g, b].iter().max().unwrap() as f32 / 255.; | |
let little_m = *[r, g, b].iter().min().unwrap() as f32 / 255.; | |
let c = big_m - little_m; | |
let s = (c / big_m) * 100.; |
This file contains hidden or 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
#!/usr/bin/env python | |
# | |
# Bradley Gannon --- 2019-07-21 | |
# | |
# Someone recently showed me the delightful collection of out-of-context | |
# quotes from the streets of Washington known as DCist Overheard. DCist has a | |
# publication-wide RSS feed, which is great, but I only really care to read | |
# Overheard, not the actual news that they publish. This script downloads the | |
# Overheard page, checks if there's a new post, and sends me an email if there | |
# is. (It actually just checks whether or not the most recent post was released |