Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.
Edit Xcode Scheme and add a pre-action script.
Copy the contents of preaction.sh
into the pre-action script box.
-- 1. Place in ~/Library/Scripts and enable the Applescript menu via the Applescript Editor | |
-- 2. Substitute "vpn.example.com" and "redacted" for your VPN server and password | |
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility | |
-- 4. Enable Applescript Editor and System UI Server | |
-- 5. Trigger script from the menu | |
-- 6. Enjoy being connected | |
tell application "Cisco AnyConnect Secure Mobility Client" | |
activate | |
end tell |
window.onscroll = function() { | |
var d = document.documentElement; | |
var offset = d.scrollTop + window.innerHeight; | |
var height = d.offsetHeight; | |
console.log('offset = ' + offset); | |
console.log('height = ' + height); | |
if (offset >= height) { | |
console.log('At the bottom'); |
#!/usr/bin/env python | |
""" | |
Setup a virtualenv with the Google App Engine SDK. | |
References: | |
http://virtualenv.readthedocs.org/en/latest/virtualenv.html#creating-your-own-bootstrap-scripts | |
http://mindtrove.info/virtualenv-bootstrapping/ | |
""" | |
import hashlib | |
import os |
// Playground is where kids play | |
import CoreData | |
@objc(City) | |
class City: NSManagedObject { | |
@NSManaged var name: String | |
} | |
var cityEntity = NSEntityDescription() |
//Property List file name = regions.plist | |
let pListFileURL = Bundle.main.url(forResource: "regions", withExtension: "plist", subdirectory: "") | |
if let pListPath = pListFileURL?.path, | |
let pListData = FileManager.default.contents(atPath: pListPath) { | |
do { | |
let pListObject = try PropertyListSerialization.propertyList(from: pListData, options:PropertyListSerialization.ReadOptions(), format:nil) | |
//Cast pListObject - If expected data type is Dictionary | |
guard let pListDict = pListObject as? Dictionary<String, AnyObject> else { | |
return | |
} |
/// Contains the coordinates of a point in a 2D Cartesian coordinate system. | |
public struct Point: Hashable { | |
/// The x-coordinate of the point. | |
public var x: Double | |
/// The y-coordinate of the point. | |
public var y: Double | |
} | |
extension Array where Element == Point { | |
/// Returns only the unique points in the array. |
Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.
Edit Xcode Scheme and add a pre-action script.
Copy the contents of preaction.sh
into the pre-action script box.
the following regex will validate all examples provided here: https://www.conventionalcommits.org/en/v1.0.0/
^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)
a grep/posix compatible variant
^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([[:alnum:]._-]+\))?(!)?: ([[:alnum:]])+([[:space:][:print:]]*)
import SwiftUI | |
struct Dial: View { | |
@Binding public var value: Double | |
public var minValue: Double = 0 | |
public var maxValue: Double = .greatestFiniteMagnitude | |
public var divisor: Double = 1 | |
public var stepping: Double = 1 | |
@State private var dialAngle: Angle = .zero | |
@State private var dialShadowAngle: Angle = .zero |
extension View { | |
func minimumPadding(edges: Edge.Set = .all, _ length: CGFloat = 8) -> some View { | |
GeometryReader { geo in | |
padding(.bottom, edges.contains(.bottom) ? max(length, geo.safeAreaInsets.bottom) : 0) | |
.padding(.top, edges.contains(.top) ? max(length, geo.safeAreaInsets.top) : 0) | |
.padding(.leading, edges.contains(.leading) ? max(length, geo.safeAreaInsets.leading) : 0) | |
.padding(.trailing, edges.contains(.trailing) ? max(length, geo.safeAreaInsets.trailing) : 0) | |
.ignoresSafeArea(edges: edges) | |
} | |
} |