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
#!/bin/bash | |
# prints California time, on macOS or Ubuntu 18 | |
exec env TZ='America/Los_Angeles' date -R |
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 Darwin | |
import Foundation | |
// known good: Swift 5 | |
// runs on macOS, probably works on iOS (but haven't tried) | |
/// Wraps `host_statistics64`, and provides info on virtual memory | |
/// | |
/// - Returns: a `vm_statistics64`, or nil if the kernel reported an error | |
/// |
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
// | |
// processFIle.swift | |
// LineIteratorProj | |
// | |
// Created by Alexis Gallagher on 8/14/19. | |
// Copyright © 2019 Sculpt Labs. All rights reserved. | |
// | |
// known-good: Swift 5 |
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 | |
// known good: Swift 5 | |
typealias LineIteratorState = ( | |
// pointer to a C string representing a line | |
linePtr:UnsafeMutablePointer<CChar>?, | |
linecap:Int, | |
filePtr:UnsafeMutablePointer<FILE>? | |
) |
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
// known-good: Swift 5.0.1 | |
/* | |
# how to use: | |
instead of: | |
for i in 0 ..< (n-1)/bs { | |
let startIdx = i * bs |
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
// | |
// Pile.swift | |
// PileTest | |
// | |
// Created by Alexis Gallagher on 3/6/19. | |
// Copyright © 2019 Bespoke. All rights reserved. | |
// | |
// known-good: Swift 4.2, iOS 12 |
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
// Zipping.swift | |
// known-good: Swift 4.2 | |
// Alexis Gallagher | |
import Foundation | |
public extension URL { | |
/// Creates a zip archive of the file or folder represented by this URL and returns a references to the zipped file | |
/// |
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
// known-good: Swift 4.2 | |
// expected good: Swift 5.0 | |
import Foundation | |
/* | |
This file defines three helpers for matching regular expressions against strings, and inspecting the results of capture groups in the regular expressions. | |
1. `RegexMatches(ofPattern:againstString:)` provides a lazy Sequence of matches, where every match is an array representing the matches capture groups. |
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
// known-good: Swift 4.2, macOS | |
import Foundation | |
import ModelIO | |
private func LogDebug(_ s:Any) -> Void { print(s) } | |
private func LogInfo(_ s:Any) -> Void { print(s) } | |
private func LogError(_ s:Any) -> Void { print(s) } | |
struct POINT3D { | |
var x:Float |
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
// known good: Swift 4.2 | |
import Foundation | |
/// Returns an iterator that iterates through the lines of the file at path. | |
/// | |
/// - Parameter path: path of the file to read | |
/// - Returns: the iterator, or nil if the file could not be read | |
func lineSequence(forFileAtPath path:String) -> AnyIterator<String>? | |
{ |