Skip to content

Instantly share code, notes, and snippets.

View tomwilsn's full-sized avatar

Tom Wilson tomwilsn

View GitHub Profile
@tomwilsn
tomwilsn / multipartbody.ex
Created February 23, 2018 04:51
Multiple file uploads with HTTPoison
{:multipart, [
{:file, path, {"form-data", [{"name", "form_field_name"}, {"filename", Path.basename(path)}]},
[{"Content-Type", MIME.from_path(path)}
],
[
{:file, path, {"form-data", [{"name", "another_name"}, {"filename", Path.basename(another_path)}]},
[{"Content-Type", MIME.from_path(another_path)}
]
}
@tomwilsn
tomwilsn / UIFont+FontNames.swift
Created September 23, 2015 00:02
Print iOS font names in Swift 2
extension UIFont {
static func printFontNames() {
for familyName in UIFont.familyNames() {
print("Family name: \(familyName)")
for fontName in UIFont.fontNamesForFamilyName(familyName) {
print("Font name: \(fontName)")
}
}
}
}