Skip to content

Instantly share code, notes, and snippets.

View wata's full-sized avatar

Wataru Nagasawa wata

View GitHub Profile
@robksawyer
robksawyer / excludedActivityTypes.swift
Last active March 7, 2024 09:10
A list of UIActivity.ActivityType for modern apps.
let excludedActivityTypes = [
UIActivity.ActivityType.print,
UIActivity.ActivityType.openInIBooks,
UIActivity.ActivityType.copyToPasteboard,
UIActivity.ActivityType.addToReadingList,
UIActivity.ActivityType.assignToContact,
UIActivity.ActivityType.copyToPasteboard,
UIActivity.ActivityType.mail,
UIActivity.ActivityType.markupAsPDF,
UIActivity.ActivityType.postToFacebook,
@1amageek
1amageek / FirestoreMonitoring.swift
Created August 19, 2020 09:56
Count Cloud Firestore Reads
//
// FirestoreMonitoring.swift
// Monitor
//
// Created by nori on 2020/08/19.
// Copyright © 2020 1amageek. All rights reserved.
//
import Foundation
import FirebaseFirestore
@ole
ole / UIAlertController+TextField.swift
Last active September 13, 2022 14:20
A UIAlertController with a text field and the ability to perform validation on the text the user has entered while the alert is on screen. The OK button is only enabled when the entered text passes validation. More info: https://oleb.net/2018/uialertcontroller-textfield/
import UIKit
/// A validation rule for text input.
public enum TextValidationRule {
/// Any input is valid, including an empty string.
case noRestriction
/// The input must not be empty.
case nonEmpty
/// The enitre input must match a regular expression. A matching substring is not enough.
case regularExpression(NSRegularExpression)
@darktable
darktable / app.yaml
Created March 16, 2011 19:10
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest