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
#!/usr/bin/env ruby | |
require 'thor' | |
require 'open-uri' | |
require 'fileutils' | |
require 'etc' | |
require 'zip' | |
require 'erb' | |
URL = "https://github.com/wess/center-stage/archive/master.zip" |
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
- (UIColor *)colorByChangingAlphaTo:(CGFloat)alpha | |
{ | |
CGFloat *oldComponents = (CGFloat *)CGColorGetComponents([self CGColor]); | |
size_t numComponents = CGColorGetNumberOfComponents([self CGColor]); | |
CGFloat newComponents[4]; | |
switch (numComponents) | |
{ | |
case 2: |
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) |
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
// | |
// 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
- (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
// | |
// 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
<!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
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
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 | |
} |