Navigation Menu

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 / rm_conflicted.sh
Last active August 29, 2015 13:57
Remove Dropbox Conflicted Files
find . -type f -name "* conflicted *" -exec rm -f {} \;
@joemasilotti
joemasilotti / remove_tag
Created May 11, 2014 13:11
Git: Remove remote tag
git tag -d 12345
git push origin :refs/tags/12345
@joemasilotti
joemasilotti / .gitconfig
Created June 23, 2015 11:41
git yesterday
[alias]
yesterday = log --graph --decorate --oneline --after='yesterday' --until='today midnight’
@joemasilotti
joemasilotti / ABVFormatter.h
Last active August 29, 2015 14:23
How to format ABV% in Objective-C.
#import <Foundation/Foundation.h>
@interface ABVFormatter : NSObject
- (NSString *)formattedABV:(NSNumber *)abv;
@end
@joemasilotti
joemasilotti / Backgrounder.h
Created July 7, 2015 16:16
Completion Blocks in Cedar
typedef void(^BackgroundCompletion)();
@interface Backgrounder : NSObject
- (void)executeInBackground:(BackgroundCompletion)completion;
@end
@joemasilotti
joemasilotti / WKUserContentController+Spec.h
Last active September 2, 2015 18:31
WKUserContentController Swizzling (breaks in Xcode 7)
#import <WebKit/WebKit.h>
@interface WKUserContentController (Spec)
- (NSDictionary *)userScriptHandlers;
@end
@joemasilotti
joemasilotti / UITest.swift
Created September 17, 2015 14:12
How to assert if a view is off screen
import XCTest
class UITests: XCTestCase {
let app = XCUIApplication()
override func setUp() {
super.setUp()
continueAfterFailure = false
app.launch()
}
@joemasilotti
joemasilotti / GuardFormatting.swift
Last active November 17, 2015 15:46
Which Swift guard formatting do you prefer?
//: Playground - noun: a place where people can play
enum Error: ErrorType {
case ParsingError
}
struct Person {
let name: String
let age: Int
@joemasilotti
joemasilotti / MyPlayground.swift
Last active December 14, 2015 22:04
Swift Array to Dictionary
//: Playground - noun: a place where people can play
struct Option {
var id: UInt
var name: String
}
func combine(options: [Option]) -> [UInt: String] {
var combinedOptions = [UInt: String]()
for option in options {
@joemasilotti
joemasilotti / UITests.swift
Created January 5, 2016 14:15
Stubbing out repeating animations in UI Testing
import XCTest
class TestCase: XCTestCase {
let app = XCUIApplication()
override func setUp() {
super.setUp()
continueAfterFailure = false
app.launchArguments = ["UI-Testing"]