Skip to content

Instantly share code, notes, and snippets.

View Ryan-M-Smith's full-sized avatar

Ryan Smith Ryan-M-Smith

View GitHub Profile
@Ryan-M-Smith
Ryan-M-Smith / canCapture.swift
Last active November 15, 2020 21:54
A Swift command line program to test if a queen on a chess board at a certain location could capture a piece at another location
//
// FILENAME: canCapture.Swift
// DESCRIPTION: A program that test if a queen on a chess board at a certain
// location could capture a piece at another location.
// COPYRIGHT: Copyright (c) 2020 by Ryan Smith
//
import Swift
func makePair(coords: String, fromKey key: [Character: Int]) -> (x: Int?, y: Int?) {
@Ryan-M-Smith
Ryan-M-Smith / README.md
Last active November 1, 2023 04:00
A simple Python library to allow you to change the color of terminal text.

ColorLib

Function wrappers for the ANSI 256-color lookup table.

How to use

Before using the library, be sure to either

import colorlib
@Ryan-M-Smith
Ryan-M-Smith / README.md
Created August 10, 2022 00:00
A Python automation script that sorts photos into certain directories based on the date they were taken.

Photo Sorter

A Python automation script that sorts photos into certain directories based on the date they were taken.

How does it work?

The script uses image metadata, specifically the date the photo was taken, to determine what directories to create and where to move the photos.

All new directories are created using os.makedirs() with exist_ok=True, so if you already have a directory named 2022 in the target directory (the place where your unsorted photos are stored), nothing will be deleted or overwritten. However, directories may be added within that directory depending on the sorting method you choose.