Skip to content

Instantly share code, notes, and snippets.

Avatar

sbm slowbrewedmacchiato

View GitHub Profile
View git-dry-merge.sh
$ 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
@slowbrewedmacchiato
slowbrewedmacchiato / Router.swift
Created Mar 8, 2021
Uploading a file in SWIFT via POST multipart/form-data blog post (2014)
View Router.swift
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: