This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command
$ docker-compose up -d
# To Tear Down
$ docker-compose down --volumes
// | |
// UDPListener.swift | |
// | |
// Created by Michael Robert Ellis on 12/16/21. | |
// | |
import Foundation | |
import Network | |
import Combine |
if [ $# != 2 ]; then | |
echo "Usage: $0 /path/to/input_ipa /path/to/output_ipa" | |
exit 1 | |
fi | |
if ! [ -f $1 ]; then | |
echo "'$1' does not exist" | |
exit 1 | |
fi |
extension UIWindow { | |
/// Traverse the window's view hierarchy in the same way as the Debug View Hierarchy tool in Xcode. | |
/// | |
/// `traverseHierarchy` uses Depth First Search (DFS) to traverse the view hierarchy starting in the window. This way the method can traverse all sub-hierarchies in a correct order. | |
/// | |
/// - parameters: | |
/// - visitor: The closure executed for every view object in the hierarchy | |
/// - responder: The view object, `UIView`, `UIViewController`, or `UIWindow` instance. | |
/// - level: The depth level in the view hierarchy. | |
func traverseHierarchy(_ visitor: (_ responder: UIResponder, _ level: Int) -> Void) { |
Foundation offers a Thread class, internally based on pthread
, that can be used to create new threads and execute closures.
// Detaches a new thread and uses the specified selector as the thread entry point.
Thread.detachNewThreadSelector(selector: Selector>, toTarget: Any, with: Any)
// Subclass
class MyThread: Thread {
def getGitCommand = { -> | |
def stdout = new ByteArrayOutputStream() | |
exec { | |
commandLine 'git', 'log','--date=local','--name-status','--after="2018.07.19"' | |
standardOutput = stdout | |
} | |
return stdout.toString().trim() | |
} | |
task prinGitLog{ |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
var thePixelBuffer : CVPixelBuffer? | |
let testImage : UIImage = UIImage.init(named: "twdEnds.png")! | |
self.thePixelBuffer = self.pixelBufferFromImage(image: testImage) | |
func pixelBufferFromImage(image: UIImage) -> CVPixelBuffer { | |