A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
-- See article here: http://daringfireball.net/2007/07/simple_inbox_sweeper | |
-- The following should be one long line: | |
set _description to "All unflagged, read messages in each IMAP account | |
inbox will be moved to the “Archive” mailbox corresponding to that | |
account. This action is not undoable." | |
tell application "Mail" | |
display alert "Archive read messages from IMAP inboxes?" buttons ¬ | |
{"Cancel", "Archive"} cancel button 1 message _description |
The regex patterns in this gist are intended only to match web URLs -- http, | |
https, and naked domains like "example.com". For a pattern that attempts to | |
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502 | |
# Single-line version: | |
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s |
<?xml version="1.0"?> | |
<profile name="Original Prusa i3 MK2" version="2017-07-16 09:26:29" app="S3D-Software 3.1.1"> | |
<baseProfile>Default</baseProfile> | |
<printMaterial>PLA</printMaterial> | |
<printQuality>Normal 0.2</printQuality> | |
<printExtruders></printExtruders> | |
<extruder name="Primary Extruder"> | |
<toolheadNumber>0</toolheadNumber> | |
<diameter>0.4</diameter> | |
<autoWidth>0</autoWidth> |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
// Run any SwiftUI view as a Mac app. | |
import Cocoa | |
import SwiftUI | |
NSApplication.shared.run { | |
VStack { | |
Text("Hello, World") | |
.padding() | |
.background(Capsule().fill(Color.blue)) |
class URLProtocolMock: URLProtocol { | |
/// Dictionary maps URLs to tuples of error, data, and response | |
static var mockURLs = [URL?: (error: Error?, data: Data?, response: HTTPURLResponse?)]() | |
override class func canInit(with request: URLRequest) -> Bool { | |
// Handle all types of requests | |
return true | |
} | |
override class func canonicalRequest(for request: URLRequest) -> URLRequest { |
import SwiftUI | |
public extension View { | |
func juxtapose<Content>( | |
edge: Edge = .top, | |
spacing: CGFloat = 8, | |
@ViewBuilder content: @escaping () -> Content | |
) -> some View where Content: View { | |
modifier( | |
JuxtaposedViewModifier( |
Currently it doesn't seem possible to execute additional logic when a navigation link is tapped with the new NavigationLink(value:)
initializer. When the link is tapped it updates path state all the way back at the root NavigationStack
to drive navigation, but there are many times where we need to perform logic after the tap and before the drill down.
For example, after tapping a link we may want to pre-emptively load some data to show on the drill down screen. Or we may want to perform some form validation. Or we may want to track some analytics. This does not seem possible with the current link API.
A workaround is to use Button
s instead of NavigationLink
s, but then you lose all of the styling and affordances given to links, such as chevrons when used in List
.
If the API for NavigationLink
cannot be changed to accomodate for this, perhaps a new ButtonStyle
could be introduced that allows regular buttons to take on the sty
import ComposableArchitecture | |
import SwiftUI | |
extension Reducer { | |
/// Returns a reducer that applies ``BindingAction`` mutations to `LocalState` on `State`. | |
/// | |
/// - Parameters: | |
/// - toLocalState: A key path that can get/set `LocalState` inside `State`. | |
/// - toLocalAction: A case path that can extract/embed `BindingAction` of `LocalState` from `Action`. | |
/// - Returns: A reducer that applies ``BindingAction`` mutations to `LocalState` on `State`. |