Skip to content

Instantly share code, notes, and snippets.

calculateScore: ->
totalToPar = 0
holes = @get 'holes'
score = 0
outScore = 0
outToPar = 0
inScore = 0
inToPar = 0
for hole in holes
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
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')
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:
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
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
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) ->
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) ->
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.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
});