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
infix operator <<< | |
class Entity : CustomDebugStringConvertible { | |
static func <<<(_ image: Entity, assignment: (ReferenceWritableKeyPath<Entity, String?>, key: Entity.Keys, source: [String : Any])) { | |
let keypath = assignment.0 | |
let value = assignment.source[assignment.key.rawValue] | |
if value != nil { | |
image[keyPath: keypath] = String(describing: value!) | |
} else { |
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
#!/bin/bash | |
# usage: get [ RESOLUTION [ YEAR [ IDS... ] ] ] | |
resolution=${1:-SD} | |
year=${2:-2015} | |
shift | |
shift | |
ids=$* | |
RESOLUTION=$(echo $resolution | tr '[:lower:]' '[:upper:]') |