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 intersection(a, b) { | |
var shorter = a, longer = b, hash = {}; | |
if (a.length > b.length) { shorter = b; longer = a; } | |
for (var i in shorter) { var o = shorter[i]; hash[o] = 1; } | |
var collisions = []; | |
for (var i in longer) { | |
var o = longer[i]; | |
if (hash[o] == 1) collisions.push(o); | |
} | |
return collisions; |
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 MyListItemView.js */ | |
MyListItemView = SC.ListItemView.design({ | |
}); | |
/* */ | |
kasesView: SC.ScrollView.design({ | |
hasHorizontalScroller: NO, | |
classNames: "kasesView", | |
layout: { top: 60, bottom: 0, left: 0, right: 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
#!/usr/bin/env python2.6 | |
## MacPorts needless dependency cleaning. Edit 'keep' first!!! | |
# | |
## requires python >= 2.6! | |
# | |
## Vincent Fiano <[email protected]> | |
# FIXME: the packages that you care about go here! | |
keep = ['libidl', 'graphviz', 'bash-completion'] |
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
(Aqua/E)macs deficiencies: | |
- working across files (projects) | |
- searching for strings in project | |
- opening other files in project | |
- viewing files, opened or not | |
- tabs | |
- cannot be reordered | |
- cannot be torn off or reparented | |
- vast over-use of control key | |
- poor file browsing |
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
http://news.ycombinator.com/item?id=952356 | |
24 points by edw519 4 days ago | link | parent | flag | |
I have worked from home off and on for years, and this is pretty good advice. The most important is the dedicated space with a door that closes. So you still "go to work", just with a very short commute. A few other things that I have found helpful: | |
- When you're in your office, you're at work, working. | |
- When you're not in your office, you're at home, not working. | |
- Work in 48 minute bursts, then take a break. | |
- Only check email & voice mail during your 12 minutes off. |
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
module("SC.ObjectController - single_enumerable_case - OBSERVABLE OBJECT", { | |
setup: function() { | |
src = SC.Object.create({ foo: "foo1", bar: "bar1" }); | |
content = SC.Set.create(); // use generic enumerable | |
controller = SC.ObjectController.create({ | |
content: content, | |
allowsMultipleContent: NO | |
}); | |
content.add(src); | |
}, |
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
/** @private - setup observer on init if needed. */ | |
init: function() { | |
sc_super(); | |
if (this.get('content')) this._scoc_contentDidChange(); | |
if (this.get('observableContent')) this._scoc_observableContentDidChange(); | |
}, | |
_scoc_contentDidChange: function () { | |
var last = this._scoc_content, | |
cur = this.get('content'); |
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
// ========================================================================== | |
// Project: WhenAbout.com / Front | |
// Copyright: ©2010 Touch of Logic LLC, Vincent Fiano <[email protected]> | |
// ========================================================================== | |
// This is sample code for DataSources and remote queries. It was compiled from | |
// multiple files, and extraneous code and comments have been removed. It | |
// probably does not function out of the box. You've been warned. | |
Front = SC.Application.create( |
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
(defmacro defrecord+fields | |
"Supply the fields of a record using a variable." | |
[name fields & specs] | |
(let [fields (eval fields)] | |
`(defrecord ~name ~fields ~@specs))) |
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
{ :size (typed conditional-set | |
:when [{ :condition (:parent :color (= "blue")) } | |
:values ["a" "b" "c"] } | |
{ :condition (:parent :color (= "red")) } | |
:values ["1" "2" "3"] } | |
]) } |
OlderNewer