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
[skew_correction] | |
[display_status] | |
[pause_resume] | |
[respond] | |
[gcode_arcs] |
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
/* === This code segfaults, and only through much trial & error + commenting out code did I narrow it down to this. === */ | |
/* | |
protocol PaymentService { | |
typealias Error = Swift.Error & CustomStringConvertible & Equatable | |
associatedtype LogInError: PaymentService.Error | |
} | |
// MyPaymentService.LogInError does not conform to Swift.Error | |
*/ | |
/* === This code compiles fine. I believe this is a bug in the compiler (conforming to the typealias, |
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 UIKit | |
enum X: ErrorType {} | |
/** | |
error: declared closure result 'UICollectionView' is incompatible with contextual type '_' | |
createItemView: { () -> UICollectionView in | |
(it should be inferring LoadStateView.ItemView as the return type of this closure) | |
*/ |
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
~> cat test.swift | |
print((0, 1) == (0, 1)) | |
/tmp | |
~> sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/ | |
/tmp | |
~> swift test.swift | |
test.swift:1:14: error: binary operator '==' cannot be applied to two '(Int, Int)' operands | |
print((0, 1) == (0, 1)) | |
~~~~~~ ^ ~~~~~~ | |
/tmp |
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
function add_command | |
complete -c carthage -a $argv[1] -d $argv[2] -f | |
end | |
function add_command_option | |
complete -c carthage -n "contains $argv[1] (commandline -poc)" -l $argv[2] -d $argv[3] | |
end | |
# Add all top level commands | |
add_command archive "Archives a built framework into a zip that Carthage can use" |
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
// warning: 'catch' block is unreachable because no errors are thrown in 'do' block | |
public func requestJSON<ModelType: MTLModel>(target: CocoaBlocAPI) -> SignalProducer<ModelType, NSError> { | |
return tryGetJSONObjectForKey(requestJSON(target), key: "data") | |
.attemptMap { (value: [NSObject:AnyObject]) -> Result<ModelType, NSError> in | |
do { | |
return Result(try MTLJSONAdapter.modelOfClass(ModelType.self, fromJSONDictionary: value) as! ModelType) | |
} | |
catch let error as NSError { | |
return .Failure(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
// 8mhz internal | |
#define F_CPU 8000000 | |
#include <avr/io.h> | |
#include <stdio.h> | |
#include <util/delay.h> | |
// 8 bit LCD logic pins | |
#define LCD_DATA_DIRECTION DDRB | |
#define LCD_DATA_PORT PORTB |
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 Madness | |
import Prelude | |
struct Brainfuck { | |
class State { | |
var bytes = ContiguousArray<UInt8>(count: 30_000, repeatedValue: 0) | |
var pointer: UInt16 = 0 | |
var deref: UInt8 { | |
get { | |
return bytes[Int(pointer)] |
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 Box<T>: Printable { | |
let unbox: T | |
init(_ value: T) { | |
self.unbox = value | |
} | |
var description: String { | |
return toString(unbox) | |
} |
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
func flatten(x: [String]) -> String { | |
return reduce(x, "", +) | |
} | |
let x = "(1,2,(3,4,(5, potato,7)),8,(9))" | |
enum Type: Printable { | |
case Element(String) | |
case Tuple([Type]) | |
NewerOlder