Skip to content

Instantly share code, notes, and snippets.

View ccabanero's full-sized avatar

Clint Cabanero ccabanero

View GitHub Profile
@ccabanero
ccabanero / AWS CLI Cheat Sheet
Last active July 4, 2019 20:56
AWS CLI Cheat Sheet
See Profiles Configured on Machine:
$ vim ~/.aws/config
$ vim ~/.aws/credentials
Create profile
$ aws configure --profile YourProfileName1
$ aws configure --profile YourProfileName2
@ccabanero
ccabanero / category-re-order
Last active September 6, 2017 22:37
category-re-order
<style>
.product-price {
display:none;
opacity: 0;
}
/* re-order categories */
.category-nav .category-nav-links {
display: -webkit-box;
display: -ms-flexbox;
@ccabanero
ccabanero / swift-lunch-ARKit
Last active August 16, 2017 20:50
swift-lunch-ARKit
Swift Lunch: Getting Started with ARKit (Augmented Reality framework for iOS 11).
Goals:
1. We'll review basic concepts of ARKit, run AR demos, review code, and go over steps to setup your development environmnet to start hacking with ARKit.
2. Discuss/brainstorm various AR prototypes that SpatialDev wants to implement over the next 1.5 months.
Time:
A minimum of 20-30 minutes. Can go longer if we want to do more code review.
@ccabanero
ccabanero / Creating a Virtual Machine of Xcode 9 Beta
Last active June 9, 2017 22:29
Creating a Virtual Machine of Xcode 9 Beta
Scenario:
1. You have an Apple Developer subscription.
2. You currently have several apps that you need to maintain/update before Xcode 9 is officially released.
3. You don't want to install Xcode 9 beta on your Mac - but you still want to play with the Xcode 9 beta.
One Possible Solution:
Use Parallels to create a virtual machine of macOS then install Xcode 9 beta on it.
Step 1: Get macOS Sierra (current Version)
a. Open the App Store application on your current version of macOS.
@ccabanero
ccabanero / Swift 3 Protocol Pattern Snippet
Created January 10, 2017 23:49
Swift 3 Protocol Pattern Snippet
// set up - MapViewController is the parent. A ContainerView is used to place the UI for directions - part of the DirectionsViewController.
// The DirectionsViewController has a protocol method for letting the delegate know when a user has tapped the 'get directions' button and passes the to and from data
// this ViewController is the delegate for the DirectionsViewController
Class MapViewController: UIViewController, DirectionsViewControllerDelegate {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// for getting access to the DirectionsViewController and settings its delegate as THIS controller
Parts of the doc that I don't want to forget ...
# finding a realm file - so you can view in Realm Browser
# link: https://realm.io/docs/swift/latest/#finding-a-realm-file
in lldb ... po Realm.Configuration.defaultConfiguration.fileURL
in terminal open the above path
# seperate realms for different users
# link: https://realm.io/docs/swift/latest/#other-realms
@ccabanero
ccabanero / git-ref
Last active February 25, 2022 16:27
git-ref
1. Create an empty develop branch (off of master) and pushes it to the server
git branch development
git push -u origin development
2. Clone the central repo and creates a tracking branch for develop
git clone url/to/repo
git checkout development
@ccabanero
ccabanero / iOS Unit Test Sample: ViewController can respond to an Unwind Segue
Created May 13, 2016 01:07
iOS Unit Test Sample: ViewController can respond to an Unwind Segue
func testSUT_CanResponseTo_UnwindSegue() {
// create source ViewController for unwind segue (i.e. the PlaceSearchViewController
let storyboard: UIStoryboard = UIStoryboard(name: "Main_iPhone", bundle: nil)
let placeSearchVC = storyboard.instantiateViewControllerWithIdentifier("PlaceSearchViewController") as! PlaceSearchViewController
placeSearchVC.targetSearchText = "Lincoln, NE"
let _ = placeSearchVC.view
// create unwind segue
let unwindSegue = UIStoryboardSegue(identifier: "unwindFromPlaceSearchViewController", source: placeSearchVC, destination: systemUnderTest)
@ccabanero
ccabanero / Sample iOS Unit Tests: Working with a ViewController composed of UISearchBar
Last active January 24, 2020 20:29
Sample iOS Unit Tests: Working with a ViewController composed of UISearchBar
import XCTest
@testable import YourProjectModule
class ViewControllerTest: XCTestCase {
var systemUnderTest: ViewController!
override func setUp() {
super.setUp()
@ccabanero
ccabanero / Sample iOS Unit Tests: View Controller has segue
Last active May 12, 2016 19:02
Sample iOS Unit Tests: View Controller has segue
import XCTest
@testable import YourProjectModule
class ViewControllerTest: XCTestCase {
var systemUnderTest: ViewController!
override func setUp() {
super.setUp()