Skip to content

Instantly share code, notes, and snippets.

//
// ContentView.swift
// NavigationViewTest
//
// Created by Thomas Visser on 04/11/2019.
// Copyright © 2019 Thomas Visser. All rights reserved.
//
import SwiftUI
@JonnyWong16
JonnyWong16 / sync_playlists_to_users.py
Last active April 20, 2024 12:14
Sync Plex playlists to shared users.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Description: Sync Plex playlists to shared users.
# Author: /u/SwiftPanda16
# Requires: plexapi
from plexapi.exceptions import NotFound
from plexapi.server import PlexServer
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos

enum ComparisonOrdering: Int {
case Ascending = 1
case Descending = -1
case Same = 0
}
infix operator <=> { precedence 130 }
protocol CombinedComparable: Comparable, Equatable {
func <=>(lhs: Self, rhs: Self) -> ComparisonOrdering
}
@mattt
mattt / regex.swift
Created August 11, 2014 18:08
Creating a regular expression object from a String literal
class Regex {
let pattern: String
let options: NSRegularExpressionOptions!
private var matcher: NSRegularExpression {
return NSRegularExpression(pattern: self.pattern, options: nil, error: nil)
}
required init(pattern: String, options: NSRegularExpressionOptions = nil) {
self.pattern = pattern
// See: https://devforums.apple.com/message/1000934#1000934
import Foundation
// Logic
operator prefix ¬ {}
@prefix func ¬ (value: Bool) -> Bool {
return !value
}
@mmorey
mmorey / StyleSettings.plist
Created January 24, 2014 11:53
Style Settings for Objective-Clean
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>kRequireSpaceAfterMethodType</key>
<true/>
<key>kRequireSpaceAfterReturnType</key>
<false/>
<key>kRequireSpaceAfterColon</key>
<false/>
/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = SQKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.
@kurahaupo
kurahaupo / foo
Last active November 8, 2022 16:49
There's no excuse for using #!/usr/bin/env ...
test
@yyolk
yyolk / _rtorrent-pushover.md
Last active October 31, 2022 00:23
rtorrent + pushover howto & sample

#script to use pushover for rtorrent notifications

Used for openelec [unofficial][unofficial] rtorrent addon but can be part of any rtorrent setup.

  1. Buy Pushover for [iOS][ios] or [Android][android]
  2. Create a new app, and upload a custom icon for your notifications.
  3. [Download][rbraw] or copy rtorrent-notification.rb into a new file
  4. Insert your new app's API token in script under token