Skip to content

Instantly share code, notes, and snippets.

View christopherkarani's full-sized avatar

Christopher Karani christopherkarani

View GitHub Profile
@christopherkarani
christopherkarani / ConcurrencyFetcher.swift
Created November 8, 2021 22:36 — forked from stinger/ConcurrencyFetcher.swift
Swift Concurrency fetcher
enum APIError: Error, LocalizedError {
case unknown, apiError(reason: String), parserError(reason: String)
var errorDescription: String? {
switch self {
case .unknown:
return "Unknown error"
case .apiError(let reason), .parserError(let reason):
return reason
}
extension UIView {
func height(constant: CGFloat) {
setConstraint(value: constant, attribute: .height)
}
func width(constant: CGFloat) {
setConstraint(value: constant, attribute: .width)
}
private func removeConstraint(attribute: NSLayoutConstraint.Attribute) {
class ArrayImpl<T> {
var space: Int
var count: Int
var ptr: UnsafeMutablePointer<T>
init(count: Int = 0, ptr: UnsafeMutablePointer<T> = nil) {
self.count = count
self.space = count
@christopherkarani
christopherkarani / countries.swift
Created February 1, 2018 09:11 — forked from maxgiraldo/countries.swift
All country codes including full name
let countries = [
"AF - Afghanistan",
"AX - Aland Islands",
"AL - Albania",
"DZ - Algeria",
"AS - American Samoa",
"AD - Andorra",
"AO - Angola",
"AI - Anguilla",
"AQ - Antarctica",
@christopherkarani
christopherkarani / us-states-array
Created January 31, 2018 11:27 — forked from iamjason/us-states-array
Swift US States Array
let state = [ "AK - Alaska",
"AL - Alabama",
"AR - Arkansas",
"AS - American Samoa",
"AZ - Arizona",
"CA - California",
"CO - Colorado",
"CT - Connecticut",
"DC - District of Columbia",
"DE - Delaware",

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@christopherkarani
christopherkarani / README-Template.md
Created December 7, 2017 11:38 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites