due today
not done
done today
// Author: SwiftUI-Lab (swiftui-lab.com) | |
// Description: Implementation of the showSizes() debugging modifier | |
// blog article: https://swiftui-lab.com/layout-protocol-part-2 | |
import SwiftUI | |
struct MeasureExample: View { | |
var body: some View { | |
VStack { |
// | |
// Combine+Pairwise.swift | |
// | |
// Created by Felix Mau on 17.05.21. | |
// Copyright © 2021 Felix Mau. All rights reserved. | |
// | |
import Combine | |
extension Publisher { |
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
#! /bin/bash | |
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION | |
# Developed for DSM 6 - 7.0.1. Not tested on other versions. | |
# Steps to install | |
# Save this script in one of your shares | |
# Edit it according to your requirements | |
# Backup /usr/syno/share/nginx/ as follows: | |
# # cd /usr/syno/share/ | |
# # tar cvf ~/nginx.tar nginx |
public class Channel<Value> { | |
private class Subscription { | |
weak var object: AnyObject? | |
private let notifyBlock: (Value) -> Void | |
private let queue: DispatchQueue | |
var isValid: Bool { | |
return object != nil |
// | |
// Obfuscator.swift | |
// SwiftObfuscatorExample | |
// | |
// Created by Mathieu White on 2016-07-03. | |
// Copyright © 2016 Mathieu White. All rights reserved. | |
// | |
import Foundation |
<?xml version="1.0" encoding="UTF-8"?> | |
<Bucket | |
type = "2" | |
version = "2.0"> | |
<Breakpoints> | |
<!-- All Exceptions --> | |
<BreakpointProxy | |
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> | |
<BreakpointContent |
extension NSTimer { | |
/** | |
Creates and schedules a one-time `NSTimer` instance. | |
- Parameters: | |
- delay: The delay before execution. | |
- handler: A closure to execute after `delay`. | |
- Returns: The newly-created `NSTimer` instance. | |
*/ |
import Foundation | |
protocol SomeDelegateProtocol : class { | |
func firstFunc() -> String | |
func secondFunc() -> Bool | |
func thirdFunc() -> Self | |
} | |
class MyClass { | |
weak var delegate : SomeDelegateProtocol? |