Skip to content

Instantly share code, notes, and snippets.

View prachigauriar's full-sized avatar

Prachi Gauriar prachigauriar

  • New York
View GitHub Profile
@prachigauriar
prachigauriar / QLCReverseStrings.m
Last active March 10, 2025 23:43
Code that reverses NSStrings using three different methods. Requires the `URLMock/TestHelpers` pod to generate random Unicode strings.
//
// main.m
// ReverseString
//
// Created by Prachi Gauriar on 3/23/2014.
// Copyright (c) 2014 Prachi Gauriar. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <URLMock/UMKTestUtilities.h>
@prachigauriar
prachigauriar / QLCDispatchAsyncWithCompletionAndTimeout.m
Last active May 28, 2022 18:23
Examples in Objective-C and Swift that use dispatch_async and dispatch_semaphore to cleanly replicate the behavior of ‑[NSCondition waitUntilDate:].
//
// QLCDispatchAsyncWithCompletionAndTimeout.m
// Blocks-WaitUntilDate
//
// Created by Prachi Gauriar on 12/23/2013.
// Copyright (c) 2013 Prachi Gauriar.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@prachigauriar
prachigauriar / NSCondition-WaitUntilDate-Example.m
Last active December 31, 2018 08:43
An example of using -[NSCondition waitUntilDate:].
//
// NSCondition-WaitUntilDate-Example.m
// NSConditionExample
//
// Created by Prachi Gauriar on 12/23/2013.
// Copyright (c) 2013 Prachi Gauriar.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights