This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
http://zoesmith.io | |
Export Bookmarks from Evernote to Pinboard | |
v1.4 12th September 2012 | |
This script takes selected notes in Evernote and sends an email for each to Pinboard, extracting each note's title, source URL and associated tags. The user should enter their Pinboard email address in the pinboardEmail property below, and can choose a default tag to add to each bookmark on import. | |
This code is hacky, horrible and non-error checking (but it worked for me). Don't use on thousands of notes at a time, it'll go all crashy. Try selecting one test note first to see if it works for you. | |
Change log: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// DarwinNotificationCenter.swift | |
// | |
// Copyright © 2017 WeTransfer. All rights reserved. | |
// | |
import Foundation | |
/// A Darwin notification payload. It does not contain any userInfo, a Darwin notification is purely event handling. | |
public struct DarwinNotification { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Withable is a simple protocol to make constructing | |
/// and modifying objects with multiple properties | |
/// more pleasant (functional, chainable, point-free) | |
public protocol Withable { | |
init() | |
} | |
public extension Withable { | |
/// Construct a new instance, setting an arbitrary subset of properties | |
init(with config: (inout Self) -> Void) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PagerView.swift | |
// | |
// Created by Majid Jabrayilov on 12/5/19. | |
// Copyright © 2019 Majid Jabrayilov. All rights reserved. | |
// | |
import SwiftUI | |
struct PagerView<Content: View>: View { | |
let pageCount: Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Context: ObservableObject { | |
init(selectedIngredients: Set<Ingredient>, ingredients: [Ingredient]) { | |
self.selectedIngredients = selectedIngredients | |
self.ingredients = ingredients | |
} | |
@Published var selectedIngredients: Set<Ingredient> | |
let ingredients: [Ingredient] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import SnapshotTesting | |
import XCTest | |
public typealias NamesToValues = [String : Double] | |
public func approximateValues(tolerance percentage: Double) -> SimplySnapshotting<NamesToValues> { | |
let diffingStrategy = Diffing.approximateValues(tolerance: percentage) | |
return SimplySnapshotting.init(pathExtension: "json", diffing: diffingStrategy) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import CoreData | |
import CloudKit | |
// https://github.com/macmade/user-defaults/blob/master/swift/Preferences.swift | |
/******************************************************************************* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Activity.swift | |
// | |
// Created by Zachary Waldowski on 8/21/16. | |
// Copyright © 2016 Zachary Waldowski. Licensed under MIT. | |
// | |
import os.activity | |
private final class LegacyActivityContext { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://oleb.net/blog/2016/08/swift-3-strings/ | |
extension String { | |
func wrapped(after: Int) -> [String] { | |
var i = 0 | |
let lines = self.characters.split(omittingEmptySubsequences: false) { character in | |
switch character { | |
case "\n", | |
" " where i >= after: | |
i = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://oleb.net/blog/2016/08/swift-3-strings/ | |
extension String { | |
func wrapped(after: Int) -> [String] { | |
var i = 0 | |
let lines = self.characters.split(omittingEmptySubsequences: false) { character in | |
switch character { | |
case "\n", | |
" " where i >= after: | |
i = 0 |
NewerOlder