This file contains 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
Mymag.SourceItemView = SC.Checkbox.extend({ | |
titleBinding: ".parentView.content.label" | |
}); | |
Mymag.sourceListController = SC.ArrayController.create({ | |
content: [ | |
{ label: "BBC News", url: "http://www.bbc.co.uk/news/" }, | |
{ label: "Snow forecast", url: "http://www.snow-forecast.com/resorts/Leysin/6day/mid" }, | |
{ label: "XE", url: "http://www.xe.com/" } | |
] |
This file contains 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
mainPane: SC.MainPane.design({ | |
childViews: "workspaceView".w(), | |
workspaceView: SC.WorkspaceView.design({ | |
topToolbar: SC.ToolbarView.design({ | |
childViews: "backButtonView forwardButtonView ".w(), | |
backButtonView: SC.LabelView.design({ | |
layout: { left: 10, width: 24, height: 24 }, |
This file contains 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
info it worked if it ends with ok | |
verbose cli [ 'C:\\Program Files (x86)\\nodejs\\\\node.exe', | |
verbose cli 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', | |
verbose cli 'install', | |
verbose cli '-g', | |
verbose cli 'brunch' ] | |
info using npm@1.1.0-alpha-2 | |
info using node@v0.6.3 | |
verbose config file C:\Users\Dave\.npmrc | |
verbose config file C:\Program Files (x86)\etc\npmrc |
This file contains 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
makeRandomArray: -> | |
for x in [0..10] | |
Math.round Math.random() * 100 | |
# How can I get the value at (x-1) here??? |
This file contains 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
<div class="row"> | |
<div class="cell">100</div> | |
</div> | |
<div class="row"> | |
<div class="cell">50</div> | |
<div class="cell">50</div> | |
</div> | |
<div class="row"> |
This file contains 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 n in [0..10] | |
callback = (n) -> console.log "Hello from #{n}" | |
setTimeout callback, n * 1000, n | |
# This works but is it a bit hacky? |
This file contains 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
class Pyramid extends Spine.Model | |
@configure "Pyramid" | |
@hasMany "rows", "models/row" | |
constructor: (rowCount) -> | |
throw new Error("Row count needs to be more than one") unless rowCount > 1 | |
(@rows().create y, row) for row, y in @createRows(rowCount) | |
createRows: (rowCount) -> | |
rows = [] |
This file contains 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
MyObject = SC.Object.extend({ | |
fullName: function() { | |
return "How to add .property() in Coffeescript?" | |
}.property() | |
}); |
This file contains 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
App = SC.Application.create() | |
### Model ### | |
class App.Game extends SC.Object | |
@createNewGame: -> | |
game = App.Game.create( { cells: [] } ) | |
for x in [0...3] | |
for y in [0...3] | |
game.get("cells").pushObject App.Cell.create { x, y } |
This file contains 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 x in [0...3] | |
for y in [0...3] | |
doSomething x, y | |
# Is there a clever Coffee way to do this is a single loop/line? |
OlderNewer