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
diff --git a/AppKit/CPArrayController.j b/AppKit/CPArrayController.j | |
index 5fefb58..729b937 100644 | |
--- a/AppKit/CPArrayController.j | |
+++ b/AppKit/CPArrayController.j | |
@@ -334,8 +334,12 @@ | |
- (CPArray)selectedObjects | |
{ | |
var objects = [[self arrangedObjects] objectsAtIndexes:[self selectionIndexes]]; | |
+ if (objects) | |
+ objects = [_CPObservableArray arrayWithArray:objects]; |
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
function dateFromRailsAPI(aString){ | |
if (!aString) | |
return; | |
var regexp = /(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)(:)?(\d\d)(\.\d+)?(Z|([+-])(\d\d)(:)?(\d\d))/, | |
matches = aString.match(new RegExp(regexp)), | |
offset = 0, | |
date = new Date(); | |
if (matches) |
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 <Foundation/CPObject.j> | |
@import "../Models/MenuItem.j" | |
@import "../Views/AccountsWindow.j" | |
@implementation MainMenuController : CPObject | |
{ | |
CPView _mainView; | |
CPString _username; | |
MenuItem mainMenu @accessors; |
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
var SharedController; | |
@implementation MyController : CPObject | |
{ | |
} | |
+ (MyController)sharedController | |
{ | |
if (!SharedController) |
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
/* | |
* CPUserDefaults.j | |
* Foundation | |
* | |
* Created by Nicholas Small. | |
* Copyright 2010, 280 North, Inc. | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either |
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
class User extends Object | |
foo: @property 'bar', -> | |
console.log 'foo' |
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 case for `extended` or something similar. | |
### | |
# Library Code | |
# mixin helper | |
mixin = (to, object) -> | |
for key, value of object | |
to[key] = value |
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
c = (obj) -> | |
(callback) -> | |
callback.call(obj) | |
foo = c 'bar' | |
alert foo -> @length | |
random = c foo: c 'bar' | |
alert random -> @foo -> @[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
class Shopify.ProductsIndexView extends Batman.View | |
# should be YourApp.ControllerActionView | |
ready: -> | |
$('span').slider() |
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
(function() { | |
var canvas = document.getElementById('canvas'); | |
var MAX_ROWS = canvas.height; | |
var MAX_COLS = canvas.width; | |
var code = "var context = document.getElementById('canvas').getContext('2d');var color;\n"; | |
var magicNumber = 255/5; | |
var pixelCount = 0; |