I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
files=/ci_scripts/*.plist | |
for f in $files | |
do | |
echo Processing $f "..." | |
productName="$(/usr/libexec/plistbuddy -c Print:ProductName: "$f")" | |
echo $productName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
/// Wrapper for the NSNotification userInfo values associated with a keyboard notification. | |
/// | |
/// It provides properties that retrieve userInfo dictionary values with these keys: | |
/// | |
/// - UIKeyboardFrameBeginUserInfoKey | |
/// - UIKeyboardFrameEndUserInfoKey | |
/// - UIKeyboardAnimationDurationUserInfoKey | |
/// - UIKeyboardAnimationCurveUserInfoKey |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
@testable import YourAppTargetname | |
class SideMenuViewControllerTest: XCTestCase { | |
var viewControllerUnderTest: SideMenuViewController! | |
override func setUp() { | |
super.setUp() | |
Print which passes are used in -O1, -O2, -O3...
opt -O2 -debug-pass=Arguments foo.ll -S -o bar.ll
Show control flow graph using opt
, spawning a new background task.
opt -view-cfg -view-background foo.ll
Debugging mit gdb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// My way of doing constants in Swift. | |
// Usage example: if(Constants.debug) { println("debug message") } | |
struct Constants { | |
// App wide things: | |
static let debug = true | |
static let production = true | |
static let appVersion = "iOS-0.1.0b300" | |
static let apiBase = "http://api.com/1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: Method chaining | |
class MethodChainig { | |
func fetchImage() -> Fetch<UIImage> { | |
let fetch = Fetch<UIImage>() | |
return fetch | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var AssociatedKey: UInt = 0 | |
private final class AssociatedObjectBox<T> { | |
let value: T | |
init(_ x: T) { | |
value = x | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1 | |
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
if [ "true" == ${ALREADYINVOKED:-false} ] | |
then | |
echo "RECURSION: Detected, stopping" | |
else | |
export ALREADYINVOKED="true" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[UIView animateKeyframesWithDuration:5.0 delay:0.0 options:0 animations:^{ | |
[UIView addKeyframeWithRelativeStartTime:0.0 relativeDuration:0.5 animations:^{ | |
self.verticalPosition.constant = 200.0; | |
[self.view layoutIfNeeded]; | |
}]; | |
[UIView addKeyframeWithRelativeStartTime:0.5 relativeDuration:0.25 animations:^{ | |
self.verticalPosition.constant = 50.0; | |
[self.view layoutIfNeeded]; | |
}]; | |
[UIView addKeyframeWithRelativeStartTime:0.75 relativeDuration:0.125 animations:^{ |