Skip to content

Instantly share code, notes, and snippets.

View bolismauro's full-sized avatar

Mauro Bolis bolismauro

View GitHub Profile
@bolismauro
bolismauro / json.swift
Last active September 7, 2016 15:09
Super simple json wrapper
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
@bolismauro
bolismauro / pandify.py
Last active May 27, 2016 13:06
Generate pandified versions of an image
import glob
import os
import tinify
SOURCE_FOLDER = 'images'
DEST_FOLDER = 'dest'
tinify.key = "jbRr5F8gUwTwAehGm_4RDK_bvYdGSLnw"
images = glob.glob("./{}/**/*.png".format(SOURCE_FOLDER))