Skip to content

Instantly share code, notes, and snippets.

# Define a function to run ffmpeg with arguments
function RunFfmpeg($arguments)
{
Write-Host "Running FFmpeg with arguments: $arguments"
$processStartInfo = New-Object System.Diagnostics.ProcessStartInfo
$processStartInfo.FileName = "ffmpeg"
$processStartInfo.Arguments = $arguments
$processStartInfo.UseShellExecute = $false
$processStartInfo.RedirectStandardOutput = $true
$process = New-Object System.Diagnostics.Process
import Foundation
import Swifter
enum HTTPMethod {
case POST
case GET
}
class HTTPDynamicStubs {
//Retain cycles are very easy to make when you have complex closures
//For example here `childRouter` is being captured as a strong in the closure
//Causing a leak for ALL routers in my app
//The funny thing was that I was looking at this piece of code for 15 minutes and couldn't find anything wrong
func addChildRouter(childRouter : Router) {
childRouters.append(childRouter)
if let removeObservable = childRouter.removeFromParentRouter {
removeObservable.subscribeNext({ [weak self] in

Swift Coding Guidelines

General

• Use self only when needed. Avoid if possible.
• Prefer let over var
• Use guard as often as possible, instead of nesting ifs.

Header documentation