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
calculateScore: -> | |
totalToPar = 0 | |
holes = @get 'holes' | |
score = 0 | |
outScore = 0 | |
outToPar = 0 | |
inScore = 0 | |
inToPar = 0 | |
for hole in holes |
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
if 9 >= holeNumber >= 1 | |
outScore += holeScore if holeScore | |
outToPar += holeScore - par if par.length and holeScore | |
else | |
inScore += holeScore if holeScore | |
inToPar += holeScore - par if par.length and holeScore |
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
hsc.models.initStore = -> | |
server = require('com.obscure.TiTouchDB'); | |
hsc.models.db = db = server.databaseNamed('hackersc'); | |
db.ensureCreated(); | |
hsc.models.design = design = db.designDocumentWithName 'hsc' | |
currentRoundMap = " | |
function(doc) { | |
if (doc.type === 'round' && doc.status === 'current') |
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
Error: Failed executing: make install (erlang.rb:99) | |
If `brew doctor` does not, this may help you fix or report the issue: | |
https://github.com/mxcl/homebrew/wiki/bug-fixing-checklist | |
--- | |
Error: Unbrewed dylibs were found in /usr/local/lib. | |
If you didn't put them there on purpose they could cause problems when | |
building Homebrew formulae, and may need to be deleted. | |
Unexpected dylibs: |
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
for opt in hsc.ui.ScrollPicker.SHOT_ORIGINS | |
label = Ti.UI.createLabel | |
layout: 'horizontal' | |
width: 85, | |
height: 26 | |
font: fontSize: 16, fontWeight: 'bold' | |
text: opt | |
borderColor: 'white' | |
borderRadius: 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
constructor: (@props = top: 0, left: 0, width: 100, height: 20, text: 'Tap to Enter...')-> | |
@container = Ti.UI.createView | |
visible: true | |
top: @props.top | |
left: @props.left | |
width: @props.width + 2 | |
height: @props.height + 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
for color, i in ['yellow', 'red', 'white', 'blue', 'red'] | |
@container.add view = Ti.UI.createView | |
backgroundColor: color | |
top: 2 | |
left: 2 + 42 * i | |
height: 20, | |
width: 40 | |
view.addEventListener 'click', ((color, selection) -> | |
(e) -> |
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
for color, i in ['yellow', 'red', 'white', 'blue', 'red'] | |
@container.add view = Ti.UI.createView | |
backgroundColor: color | |
top: 2 | |
left: 2 + 42 * i | |
height: 20, | |
width: 40 | |
view.addEventListener 'click', do (color) -> | |
(color) -> |
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
i = 0 | |
colors = ['yellow', 'red', 'white', 'blue', 'red'] | |
for color in colors | |
do (color) => | |
view = Ti.UI.createView | |
backgroundColor: color | |
top: 2 | |
left: 2 + 42*i | |
height: 20, | |
width: 40 |
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
this.selection.addEventListener('click', function() { | |
Ti.API.info('tee type clicked'); | |
if (_this.state === 'closed') { | |
Ti.API.info('open'); | |
_this.state = 'opened'; | |
return _this.container.animate({ | |
width: 212, | |
duration: 3000, | |
curve: Titanium.UI.iOS.ANIMATION_CURVE_EASE_IN_OUT | |
}); |