View prepare-xcode-project.bash
#!/bin/bash -x | |
# create the ignore file | |
cat > .gitignore <<_EOF_ | |
# Xcode | |
# | |
.DS_Store | |
build/ | |
*.pbxuser | |
!default.pbxuser |
View SwiftShell header.swift
import Foundation | |
class NSFileHandle { | |
} | |
struct String { | |
} | |
protocol Streamable { | |
} |
View listallexecutablesinpath.swift
#!/usr/bin/env swiftshell | |
import SwiftShell | |
/* | |
let directories = environment["PATH"]!.split(":") | |
for directory in directories { | |
run("find \"\(directory)\" -type f -perm +ugo+x -print") |> writeTo(standardoutput) | |
} |
View trash.swift
#!/usr/bin/env swiftshell | |
/* | |
* Released under the MIT License (MIT), http://opensource.org/licenses/MIT | |
*/ | |
import SwiftShell | |
import Dispatch | |
import Cocoa |
View Queue.swift
// | |
// Queue.swift | |
// NTBSwift | |
// | |
// Created by Kåre Morstøl on 11/07/14. | |
// | |
// Using the "Two-Lock Concurrent Queue Algorithm" from http://www.cs.rochester.edu/research/synchronization/pseudocode/queues.html#tlq, without the locks. | |
// should be an inner class of Queue, but inner classes and generics crash the compiler, SourceKit (repeatedly) and occasionally XCode. |