Skip to content

Instantly share code, notes, and snippets.

View Red3nzo's full-sized avatar
🦀
Rusting

Red Red3nzo

🦀
Rusting
  • Me
  • Void
View GitHub Profile
@rozd
rozd / CurrentUer.swift
Last active July 12, 2019 19:22
CurrentUser Swift implementation for iOS
//: Playground - noun: a place where people can play
import Foundation
// MARK: Infrastructure
/// Contract for remote user service
protocol UserService {
func signIn(completion handler: (User?) -> ())
}
@mackuba
mackuba / macbook-pro-2016.md
Created January 18, 2017 03:06
MacBook Pro 2016 - an iOS developer's review

MacBook Pro 2016 - an iOS developer's review

Here are some thoughts about my new MacBook Pro that I've been using for the last few weeks (the Santa Claus from DHL brought it to me just before Christmas), hopefully this will help someone who's considering getting one.

Note: this is written from the perspective of a person who switched to the MBP from a 2015 13" MacBook Air (i7) and also has a 2012 21" iMac. Your experiences will obviously be different if you have e.g. a fairly recent 15" Retina MacBook Pro.

Specs

  • MacBook Pro 15", late 2016
  • Core i7 2.9 GHz (4 cores)
@stinger
stinger / RxSwiftMVVM.swift
Created January 2, 2017 15:07
RxSwift MVVM
import RxSwift
// -- View Model
struct LoginViewModel {
var username = Variable<String>("")
var password = Variable<String>("")
var isValid : Observable<Bool>{
return Observable.combineLatest( self.username, self.password)
@michaelevensen
michaelevensen / PagingCollectionViewController.swift
Last active April 10, 2024 08:46
An example of perfectly paging horizontal UICollectionViewController with overflowing cells. Works great with Storyboard — no need to set any specific attributes, just add this Class to the Controller and set your desired size for the cells like you would normally.
import UIKit
private let reuseIdentifier = "Cell"
class CollectionViewController: UICollectionViewController {
/* Custom scrollView for paging */
let pagingScrollView = UIScrollView()
/* Return item size */
@RishabhVerma
RishabhVerma / Flask-Restful_S3_File_Upload.py
Last active November 3, 2021 01:41
Uploading a file to S3 while using Flask with Flask-Restful to create a REST API.
# -*- coding: utf-8 -*-
"""
An example flask application showing how to upload a file to S3
while creating a REST API using Flask-Restful.
Note: This method of uploading files is fine for smaller file sizes,
but uploads should be queued using something like celery for
larger ones.
"""
from cStringIO import StringIO