Skip to content

Instantly share code, notes, and snippets.

View art-divin's full-sized avatar
🌏
Working from everywhere

Ruslan A. art-divin

🌏
Working from everywhere
View GitHub Profile
@hyuni
hyuni / wwdc.sh
Created July 18, 2018 13:31 — forked from idiomatic/wwdc.sh
Fetch WWDC videos, slides, and sample code.
#!/bin/bash
# usage: get [ RESOLUTION [ YEAR [ IDS... ] ] ]
resolution=${1:-SD}
year=${2:-2015}
shift
shift
ids=$*
RESOLUTION=$(echo $resolution | tr '[:lower:]' '[:upper:]')
@art-divin
art-divin / Entity.swift
Created March 7, 2019 05:44
Swift deserialization
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 {