Skip to content

Instantly share code, notes, and snippets.

View hossamghareeb's full-sized avatar

Hossam Ghareeb hossamghareeb

View GitHub Profile
@hossamghareeb
hossamghareeb / AppDelegate.swift
Created January 3, 2021 11:10
Bypassing AppDelegate and Scene delegate for Unit testing in iOS
Remove @main or @UIApplicationMain
@stettix
stettix / things-i-believe.md
Last active July 10, 2024 23:00
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

@raven
raven / SafariUITests.swift
Created November 28, 2017 11:46
Launching Mobile Safari for iOS UITests with a specific URL
// Get a hold of Mobile Safari
let safari = XCUIApplication(bundleIdentifier: "com.apple.mobilesafari")
// Pass in the launch arguments to open specific url immediately
safari.launchArguments = ["-u", "http://google.com"]
safari.launch()
// If using deeplinks, you will need to accept the prompt
safari.buttons.matching(identifier: "Open").firstMatch.tap()
@potench
potench / arcanist.md
Last active November 25, 2021 20:44
Install Phabricator on OSX and Install arcanist

OSX Arcanist Installation Guide

Note, please replace "WWW/tools" with where ever you store your web tools.

$ mkdir ~/WWW/tools
$ cd ~/WWW/tools
$ git clone https://github.com/phacility/libphutil.git
$ git clone https://github.com/phacility/arcanist.git
@itsmattsoria
itsmattsoria / gistfil1.textile
Last active July 3, 2024 05:36
Mac Terminal Cheat Sheet

SHORTCUTS

Key/Command Description
Tab Auto-complete files and folder names
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + U Clear the line before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + W Delete the word before the cursor
Ctrl + T Swap the last two characters before the cursor
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@benvium
benvium / FadeSplash.m
Created September 28, 2012 09:05
iOS: Fade from the splash screen to your initial view. Works on iPhone 5 (and 4,3). Add a UIImageView property called splashView.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//.. do other setup
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
// Transition neatly from splash screen
// Very odd, on iPhone 5 you need to position the splash screen differently..
@leovandriel
leovandriel / gist:3794804
Created September 27, 2012 15:59
NWURLConnection - an NSURLConnectionDelegate based on blocks with cancel
// NWURLConnection - an NSURLConnectionDelegate based on blocks with cancel.
// Similar to the `sendAsynchronousRequest:` method of NSURLConnection, but
// with `cancel` method. Requires ARC on iOS 6 or Mac OS X 10.8.
// License: BSD
// Author: Leonard van Driel, 2012
@interface NWURLConnection : NSObject<NSURLConnectionDelegate>
@property (nonatomic, strong) NSURLRequest *request;
@property (nonatomic, strong) NSOperationQueue *queue;