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
enum JSONResult<V> { | |
case value(V) | |
case none | |
func get(_ key: String) -> JSONResult<[String: Any]> { | |
if let v = self.get(key, as: [String: Any].self) { | |
return .value(v) | |
} | |
return .none |
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
import glob | |
import os | |
import tinify | |
SOURCE_FOLDER = 'images' | |
DEST_FOLDER = 'dest' | |
tinify.key = "jbRr5F8gUwTwAehGm_4RDK_bvYdGSLnw" | |
images = glob.glob("./{}/**/*.png".format(SOURCE_FOLDER)) |