Skip to content

Instantly share code, notes, and snippets.

@woodyjhonson
woodyjhonson / CountdownTests.swift
Created March 26, 2024 09:13 — forked from JonnyBeeGod/CountdownTests.swift
This code allows for testing UNNotificationCenter and UNNotificationSettings
func testNotifications() {
// map all authorizationStatus with expected Result
let authorizationStatusMap: [UNAuthorizationStatus: Int] = [.authorized: 1, .denied: 0, .notDetermined: 0, .provisional: 1]
UNNotificationSettings.swizzleAuthorizationStatus()
authorizationStatusMap.forEach { (key: UNAuthorizationStatus, value: Int) in
UNNotificationSettings.fakeAuthorizationStatus = key
let mockCenter = UserNotificationCenterMock()
let mockCoder = MockNSCoder()
@woodyjhonson
woodyjhonson / vhost.conf
Created June 9, 2019 17:05 — forked from ponich/vhost.conf
Apache Virtual Host
<VirtualHost *:80>
ServerName hostname.com
ServerAdmin email@gmail.com
ServerAlias www.hostname.com
DocumentRoot /var/www/hostname.com/public_html
<Directory /var/www/hostname.com/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All