Skip to content

Instantly share code, notes, and snippets.

View ATahhan's full-sized avatar
Turning coffee into code

Ammar AlTahhan ATahhan

Turning coffee into code
  • Riyadh, KSA
View GitHub Profile
@ATahhan
ATahhan / AsyncQueueDispatcher.swift
Last active April 25, 2022 21:12
Wrapper around `DispatchQueue` of iOS to make it easier to inject it in systems under testing. Referenced in <Link>.
final public class AsyncQueueDispatcher: Dispatcher {
private let queue: DispatchQueue
public init(queue: DispatchQueue) {
self.queue = queue
}
public func dispatch(_ work: @escaping ()->Void) {
queue.async(execute: work)
}
@ATahhan
ATahhan / feature_branch.sh
Created November 10, 2020 07:00
Script to create a new feature and sub-feature branches
# Paste inside '.bash_aliases' file in your root directory
# Parameters:
# $1 = New feature branch name (without 'feat/' prefix)
# $2 = Base branch to start the feature branch from (optional)
function feature_branch() {
current_branch=""
if [ -z "$2" ]
then
@ATahhan
ATahhan / UIView+AdvancedAnchor.swift
Last active July 5, 2023 13:58
Multiple flavors of advancedAnchor functions to make coding constraints faster and more enjoyable
//
// UIView+AdvancedAnchor.swift
//
// Created by Ammar Altahhan on 06/08/2019.
// Copyright © 2019 Ammar Altahhan. All rights reserved.
//
// Github: https://github.com/ATahhan
// Twitter: https://twitter.com/atahhan_
//