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.
# Thanks to: https://medium.com/doraoutloud/migrating-your-apple-notes-to-evernote-12114418ba00 | |
# Open "Script Editor" application, paste and run. | |
tell application "Notes" | |
set theMessages to every note | |
repeat with thisMessage in theMessages | |
set myTitle to the name of thisMessage |
/// ContentLoader is a lightweight state manager for loading and displaying content and/or errors. | |
/// It allows you to repeatedly make requests and display new content or cached content in the event of an error. | |
/// Commonly known as RemoteData or LCE (Loading / Content / Error). | |
/// Inspired by https://tech.instacart.com/lce-modeling-data-loading-in-rxjava-b798ac98d80 | |
/// | |
final class ContentLoader<T> { | |
init() { } | |
@discardableResult func loader(_ loader: (() -> Void)?) -> ContentLoader<T> { | |
self.loader = loader |
\ |
// The image is originally animated on to the view controller then added to the scroll view. | |
// So, there might be some animation residue in here. | |
// Class needs: <UIScrollViewDelegate> | |
func viewDidLoad() { | |
let width = UIScreen.mainScreen().bounds.size.width | |
let aspect: CGFloat = width / shotWidth | |
var frame = CGRectMake(0, 0, shotWidth * aspect, shotHeight * aspect) | |
self.scrollView = UIScrollView(frame: frame) |
extension NSRegularExpression { | |
convenience init(substrings: [String], options: NSRegularExpression.Options) throws { | |
let escapedSubstrings: [String] = substrings.map(NSRegularExpression.escapedTemplate) | |
let pattern: String = escapedSubstrings.joined(separator: "|") | |
try self.init(pattern: pattern, options: options) | |
} | |
convenience init?(with pattern: String, options: NSRegularExpression.Options = []) { | |
do { | |
try self.init(pattern: pattern, options: options) |
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.
#!/bin/sh | |
# | |
# (c) 2015, Andrew Crookston <andrew@caoos.com> | |
# Licence: GPLv2 | |
# | |
# Configure it by using the pidfiles env. Format: name:pidfile name:pidfile. e.g.: | |
# | |
# [proc_mem_pid] | |
# env.pidfiles munin-node:/var/run/munin/munin-node.pid | |
# |
#!/bin/bash | |
DEVICES=`adb devices | tail -n +2 | cut -f1` | |
for DEVICE in $DEVICES | |
do | |
RUN="adb -s $DEVICE $@" | |
echo $RUN | |
${RUN} | |
done |
#!/bin/sh | |
# | |
# Extended 2015 by Andrew Crookston <andrew@caoos.com> to use pidfiles instead of process names | |
# Original (c) 2010, Andrew Johnstone andrew @ajohnstone.com | |
# Based on the 'proc_mem' plugin, written by Rodrigo Sieiro rsieiro @gmail.com | |
# | |
# Configure it by using the pidfiles env. Format: name:pidfile name:pidfile. e.g.: | |
# | |
# [proc_cpu_pid] | |
# env.pidfiles munin-node:/var/run/munin/munin-node.pid |
Sources include, but not limited to: