This file contains hidden or 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 | |
let args = (Process.arguments[1..<Process.arguments.count]) | |
let argString = args.joinWithSeparator(" ") | |
print("Arguments: \(argString)") | |
This file contains hidden or 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
let message = "Hello World" | |
let contentLength = message.utf8.count | |
server.write("HTTP/1.1 200 OK\n") | |
server.write("Server: Pilot Example \n") | |
server.write("Content-length: \(contentLength)\n") | |
server.write("Content-type: text-plain\n") | |
server.write("\r\n") | |
server.write(message) |
This file contains hidden or 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 collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { | |
guard let charge = charges[indexPath.item] as Charge else { fatalError("Invalid index") } | |
guard let cell = collectionView.dequeueReusableCellWithReuseIdentifier(CellIdentifier, forIndexPath: indexPath) as? ChargeKeypadCell else { fatalError("Invalid Cell for charge view") } | |
cell.charge = charge | |
return cell | |
} |
This file contains hidden or 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 | |
typealias Socket = Int32 | |
typealias SocketAddress = sockaddr_in | |
typealias SocketPort = UInt16 | |
public enum HTTPError : ErrorType { | |
case Binding | |
case Address | |
} |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title></title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- <link rel="stylesheet" type="text/css" href="components/bootstrap/dist/css/bootstrap.min.css"> --> | |
<!-- <script type="text/javascript" src="components/jquery/dist/jquery.min.js"></script> --> | |
<!-- <script type="text/javascript" src="components/bootstrap/dist/js/bootstrap.min.js"></script> --> |
This file contains hidden or 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
// | |
// Request.swift | |
// Swipe | |
// | |
// Created by Wesley Cope on 9/15/15. | |
// Copyright © 2015 Wess Cope. All rights reserved. | |
// | |
import Foundation |
This file contains hidden or 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
- (float) productOfA: (const float) a b: (const char) b { | |
if (b > 0) | |
return a; | |
if (b < 0) | |
return -a; | |
return 0; | |
} |
This file contains hidden or 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
// | |
// Byway.swift | |
// Byway | |
// | |
// Created by Wesley Cope on 7/16/15. | |
// Copyright © 2015 Wess Cope. All rights reserved. | |
// | |
/* USAGE: |
This file contains hidden or 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
// | |
// Alter.swift | |
// Alter | |
// | |
// Created by Wesley Cope on 7/16/15. | |
// Copyright © 2015 Wess Cope. All rights reserved. | |
// | |
/* USAGE: |
This file contains hidden or 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
extension CGImage { | |
func blurEffect(boxSize: Float) -> CGImageRef! { | |
let boxSize = boxSize - (boxSize % 2) + 1 | |
let inProvider = CGImageGetDataProvider(self) | |
let height = vImagePixelCount(CGImageGetHeight(self)) | |
let width = vImagePixelCount(CGImageGetWidth(self)) | |
let rowBytes = CGImageGetBytesPerRow(self) |