Skip to content

Instantly share code, notes, and snippets.

View OscarSwanros's full-sized avatar

Oscar Swanros OscarSwanros

View GitHub Profile
@OscarSwanros
OscarSwanros / multipart_form_upload.swift
Created September 3, 2017 00:02
File Upload to S3 in Swift
//
// UploadFileToS3Operation.swift
// VecinioAPIKit
//
// Created by Oscar Swanros on 9/2/17.
// Copyright © 2017 Vecinio Technologies Inc. All rights reserved.
//
final public class UploadFileToS3Operation: P3Operation {
public let image: UIImage
//
// ViewController.swift
// Test
//
// Created by Oscar Swanros on 3/3/17.
// Copyright © 2017 Pacific3. All rights reserved.
//
import UIKit
@OscarSwanros
OscarSwanros / main.swift
Last active January 3, 2017 18:23
Execute on main thread
public func p3_executeOnMainThread(handler: (Void) -> Void) {
if Thread.isMainThread {
handler()
} else {
DispatchQueue.main.sync(execute: handler)
}
}
func main() {
p3_executeOnMainThread {
ssh-keygen -t rsa -b 4096 -C "nancy@pacific3.net" # Genera una llave con tu correo. Te va a pedir una ubicacion, luego un
# passhphrase y una confirmacion del passphrase. Deja todo en blanco.
eval "$(ssh-agent -s)" # Activa el servidor SSH. Te debe salir algo como: Agent pid 35677
ssh-add ~/.ssh/id_rsa # agrega la llave que acabas de generar a la lista de llaves permitidas
pbcopy < ~/.ssh/id_rsa.pub # copia la llave al portapapeles
class MyController: UIViewController {
static var activeInstances: Int = 0
init() {
super.init()
MyController.activeInstances += 1
}
dealloc {
=== BUILD TARGET P3UIKit OF PROJECT P3UIKit WITH THE DEFAULT CONFIGURATION (Release) ===
Check dependencies
=== BUILD TARGET CallicoKit OF PROJECT Callico WITH THE DEFAULT CONFIGURATION (Release) ===
Check dependencies
Write auxiliary files
write-file /Users/Swanros/Documents/Pacific3/callico-ios/build/Callico.build/Release-iphoneos/CallicoKit.build/CallicoKit-all-non-framework-target-headers.hmap
@OscarSwanros
OscarSwanros / .gitignore
Created August 9, 2016 16:04
.gitignore xcode
build/
DerivedData
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
Copperplate-Light
Copperplate
Copperplate-Bold
IowanOldStyle-Italic
IowanOldStyle-Roman
IowanOldStyle-BoldItalic
IowanOldStyle-Bold
KohinoorTelugu-Regular
KohinoorTelugu-Medium
KohinoorTelugu-Light
@OscarSwanros
OscarSwanros / copyable.swift
Last active January 22, 2016 20:10
Custom Copyable
import Foundation
protocol Copyable {
typealias C
init()
func _copy() -> C
}
class CopyBox<T: Copyable> {
@OscarSwanros
OscarSwanros / .gitignore
Created January 15, 2016 04:03
Xcode Swift Gitignore
build/
DerivedData
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3