This file has been truncated, but you can view the full file.
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
{:type :document, | |
:content | |
[{:type :document-type, | |
:attrs | |
{:name "html", | |
:publicid "-//W3C//DTD XHTML 1.0 Transitional//EN", | |
:systemid | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"}} | |
{:type :element, | |
:attrs {:xmlns "http://www.w3.org/1999/xhtml"}, |
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
In init: | |
-(instancetype)init{ | |
... | |
_sections = @[ | |
@[@"Twitter",@"Blog",@"Contact Us"], | |
@[@"nameone",@"nametwo",@"namethree"] | |
]; | |
... |
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 + <T> (left: T[], right: T[]) -> T[] { | |
var newArray : T[] = [] | |
for item in left { | |
newArray.append(item) | |
} | |
for item in right { | |
newArray.append(item) | |
} | |
return newArray; | |
} |
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 UIKit | |
class Square { | |
var sideLength: Double | |
init(sideLength: Double, name: String) { | |
self.sideLength = sideLength | |
} | |
init(sideSlipperyness: Double, name: String) { |
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
// | |
// ViewController.swift | |
// Silverton Resource Tracker | |
// | |
// Created by Michael Langford on 6/2/14. | |
// Copyright (c) 2014 Rowdy Labs LLC. All rights reserved. | |
// | |
import UIKit |
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 individualScores = [75, 43, 103, 87, 12] | |
var teamScore = 0 | |
if 75 > 50 { | |
teamScore += 3 //this makes teamScore go from 0->3 | |
} else { | |
teamScore += 1 | |
} | |
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
BasedOnStyle: Chromium | |
AlignTrailingComments: true | |
BreakBeforeBraces: Stroustrup | |
ColumnLimit: 0 | |
IndentWidth: 4 | |
KeepEmptyLinesAtTheStartOfBlocks: false | |
AllowShortIfStatementsOnASingleLine: true | |
ObjCSpaceAfterProperty: true | |
ObjCSpaceBeforeProtocolList: true | |
PointerBindsToType: false |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
@implementation SwiperViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
UIScreenEdgePanGestureRecognizer *edgePanLeft = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handleEdgePanLeft:)]; | |
edgePanLeft.edges = UIRectEdgeLeft; | |
[self.view addGestureRecognizer:edgePanLeft]; | |
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
- (NSArray*)sortArrayByY:(NSArray*)array{ | |
return [array sortedArrayUsingComparator:^NSComparisonResult(id label1, id label2) { | |
if ([label1 frame].origin.y < [label2 frame].origin.y) return NSOrderedAscending; | |
else if ([label1 frame].origin.y > [label2 frame].origin.y) return NSOrderedDescending; | |
else return NSOrderedSame; | |
}]; | |
} | |
- (void)clearTextInArray:(NSArray*)array{ | |
for (UILabel* label in array){ |