Skip to content

Instantly share code, notes, and snippets.

View gauravkeshre's full-sized avatar

Gaurav K gauravkeshre

View GitHub Profile
@mbehan
mbehan / build-uploader.sh
Last active May 19, 2016 07:56
Uploads builds produced by Xcode bots
#!/bin/bash
files=/ci_scripts/*.plist
for f in $files
do
echo Processing $f "..."
productName="$(/usr/libexec/plistbuddy -c Print:ProductName: "$f")"
echo $productName
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 13, 2025 07:55
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

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!






\

@kristopherjohnson
kristopherjohnson / KeyboardNotification.swift
Last active October 6, 2023 14:45
Swift convenience wrapper for the userInfo values associated with a UIKeyboard notification
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
@ccabanero
ccabanero / Sample iOS Unit Tests: Working with a ViewController composed of TableViews
Last active November 9, 2023 09:00
Sample iOS Unit Tests: Working with a ViewController composed of TableViews
import XCTest
@testable import YourAppTargetname
class SideMenuViewControllerTest: XCTestCase {
var viewControllerUnderTest: SideMenuViewController!
override func setUp() {
super.setUp()
@vollkorn
vollkorn / gist:61596aeea691691c0fed
Last active October 20, 2017 07:43
LLVM Cheat sheet

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

@samuelbeek
samuelbeek / constants.swift
Last active October 21, 2015 18:55
Constants in Swift
// 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"
anonymous
anonymous / method-chaining.swift
Created October 19, 2015 21:57
Method Chaining
// MARK: Method chaining
class MethodChainig {
func fetchImage() -> Fetch<UIImage> {
let fetch = Fetch<UIImage>()
return fetch
}
}
@FranDepascuali
FranDepascuali / AssociatedObjects.swift
Last active April 7, 2022 18:37
Full implementation
private var AssociatedKey: UInt = 0
private final class AssociatedObjectBox<T> {
let value: T
init(_ x: T) {
value = x
}
}
@atsepkov
atsepkov / universal-framework.sh
Last active February 18, 2021 06:26 — forked from cromandini/universal-framework.sh
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures). This version works with Cocoapods, merging simulator and device architectures for intermediate libraries as well. To use this script, go to Product > Scheme > Edit S…
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"
[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:^{