Skip to content

Instantly share code, notes, and snippets.

View joemasilotti's full-sized avatar
📱
Helping Rails developers build iOS and Android apps with Turbo Native.

Joe Masilotti joemasilotti

📱
Helping Rails developers build iOS and Android apps with Turbo Native.
View GitHub Profile
@joemasilotti
joemasilotti / About.md
Last active February 25, 2016 22:16
NSDate Manipulation in iOS 8

This gist accompanies the blog post NSDate Manipulation Made Easy in iOS 8.

Apple quietly introduced a whole new suite of public API methods to NSCalendar in iOS 8 titled “Calendrical Calculations”. For some reason they seemed to have forgotten to include them in the public documentation on their developer site. Fortunately, digging in to the header file in Xcode reveals lots of descriptive comments about how to use these powerful new ways of interacting with NSDate objects.

@joemasilotti
joemasilotti / AddressFormatter.swift
Created March 27, 2016 20:44
AddressFormatter in Swift
import CoreLocation
struct AddressFormatter {
private let placemark: Placemarkable
init(placemark: Placemarkable) {
self.placemark = placemark
}
func formattedAddress() -> String {
@joemasilotti
joemasilotti / URLSessionDataTaskProtocol.swift
Last active November 21, 2016 19:03
Trying to mock NSURLConnection
protocol URLSessionDataTaskProtocol {
func resume()
}
extension NSURLSessionDataTask: URLSessionDataTaskProtocol { }
@joemasilotti
joemasilotti / Testing View Controllers in Swift 3.0
Last active September 10, 2017 22:39
Testing View Controllers in Swift 3.0
.
@joemasilotti
joemasilotti / XcodeCheatSheet.md
Last active August 13, 2018 17:17
Xcode Cheat Sheet

##Xcode Locations

###Xcode Provisioning Profiles:

~/Library/MobileDevice/Provisioning\ Profiles

###Xcode Font and Color Schemes:

~/Library/Developer/Xcode/UserData/FontAndColorThemes
@joemasilotti
joemasilotti / bootstrap4_breadcrumbs_builder.rb
Last active October 22, 2019 21:37 — forked from SaladFork/bootstrap4_breadcrumbs_builder.rb
`breadcrumbs_on_rails` builder with Bootstrap 4 compatible output
# `Bootstrap4BreadcrumbsBuilder `is a Bootstrap 4 (alpha6) compatible breadcrumb
# builder. It is designed to work with the `breadcrumbs_on_rails` gem as a
# drop-in builder replacement.
#
# Bootstrap4BreadcrumbsBuilder accepts a limited set of options:
#
# | option | default | description |
# | ---------------- | ------- | ------------------------------------------ |
# | `:container_tag` | `:ol` | What tag to use for the list container |
# | `:tag` | `:li` | What HTML tag to use for breadcrumb items |
@joemasilotti
joemasilotti / Application.swift
Created February 28, 2020 17:45
Roll your own iOS dependency injection
protocol Injectable: class {
var router: Routable { get }
}
class Injector: Injectable {
lazy var router: Routable { Router() }()
}
protocol Routable {
func route(url: String)
@joemasilotti
joemasilotti / About.md
Last active March 26, 2020 09:35
Building NSURL Queries with NSURLQueryItems and NSURLComponents
@joemasilotti
joemasilotti / ContentView.swift
Last active August 4, 2020 19:27
SwiftUI List/ForEach with bindings
import SwiftUI
struct ContentView: View {
@ObservedObject private var signalStore = SignalStore()
var body: some View {
VStack {
List(signalStore.all) { signal in
SignalView(signal: self.signalStore.binded(signal: signal))
}
@joemasilotti
joemasilotti / killsim.sh
Last active October 17, 2020 11:28
Kill iOS Simulator Zombie Processes
ps aux | grep _sim | grep -v grep | awk '{print $2}' | xargs kill -9 2>/dev/null