Skip to content

Instantly share code, notes, and snippets.

protocol RandomNumberGeneratorViewControllerProtocol: AnyObject {
// A protocol for creating view controllers that can show an array of numbers
func showNumbers(_ numbers: [Int])
// A protocol for creating view controllers that can show an error message
func showError(_ error: Error)
}
class RandomNumberGeneratorViewController: UIViewController, RandomNumberGeneratorViewControllerProtocol {
private let presenter: RandomNumberGeneratorPresenterProtocol
private let debouncer: DebouncerProtocol
import XCTest
import CoreLocation
class RBLocationManagerTests: XCTestCase {
var locationManager: RBLocationManager!
override func setUp() {
super.setUp()
locationManager = RBLocationManager.shared
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
config.build_settings['OTHER_CFLAGS'] = "$(inherited) -Qunused-arguments -Xanalyzer -analyzer-disable-all-checks"
config.build_settings['CLANG_ENABLE_CODE_COVERAGE'] = 'NO'
end
end
end
//
// Calendar+Extension.swift
// Align-iOS
//
// Created by Basel Farag on 12/6/20.
//
import Foundation
extension Calendar {
class MyViewModel {
let title: String
init(title: String) {
self.title = title
}
func printAction() {
print("executing business logic")
import UIKit
class TestView: UIView {
@IBOutlet var contentView: UIView!
@IBOutlet weak var mainLabel: UILabel!
override init(frame: CGRect) {
super.init(frame: frame)
commonInit()
struct RegExp {
/**
Check password complexity
- parameter password: password to test
- parameter length: password min length
- parameter patternsToEscape: patterns that password must not contains
- parameter caseSensitivty: specify if password must conforms case sensitivity or not
- parameter numericDigits: specify if password must conforms contains numeric digits or not
@Jxrgxn
Jxrgxn / PullToRefreshTTest.swift
Last active July 15, 2016 15:07
Proposed Approach to Hyperlinks
//
// StockQuoteItem.swift
// testProject
//
// Created by Basel Farag on 7/15/16.
// Copyright © 2016 Basel Farag. All rights reserved.
import Foundation
//beginning fuction
function countScores(Array) {
array = Array;
x = 0;
//creating a variable that iterates the array and houses the new info.
//for (var x = 0; x < array.length; x++){
for (var y in array) {
//define segregation criteria
if (array[y] > 50){
x++;
@Jxrgxn
Jxrgxn / gist:c0ba8cdabf4705f798749d721f2fa172
Created June 30, 2016 20:45 — forked from abury/gist:1404051
Simple iOS Build Script
#!/bin/sh
# Simple iOS build script
# Written by Aron Bury, 29/11/2011
appname="AwesomeApp"
target_name="$appname"
sdk="iphoneos"
certificate="iPhone Developer: Joe Blogs"