Skip to content

Instantly share code, notes, and snippets.

View slowbrewedmacchiato's full-sized avatar

sbm slowbrewedmacchiato

View GitHub Profile
@slowbrewedmacchiato
slowbrewedmacchiato / Router.swift
Created March 8, 2021 03:51
Uploading a file in SWIFT via POST multipart/form-data blog post (2014)
import Foundation
import Alamofire
public enum Router:URLRequestConvertible {
public static let baseUrlString:String = "http://testapi.example.com"
case Upload(fieldName: String, fileName: String, mimeType: String, fileContents: NSData, boundaryConstant:String);
var method: Alamofire.Method {
switch self {
case Upload:
@slowbrewedmacchiato
slowbrewedmacchiato / git-dry-merge.sh
Created March 8, 2021 03:53
HowTo: Git Dry Merge
$ git merge --no-commit --no-ff $BRANCH
$ git pull $REMOTE $BRANCH
# uh oh, that wasn't right
$ git reset --hard ORIG_HEAD
# all is right with the world
#see diff between current master and remote branch
$ git diff master origin/master