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
| /* Assume that this component exists somewhere: */ | |
| twttr.klass('twttr.components.Person', function(name, location) { | |
| this.name = name; | |
| this.location = location; | |
| }); | |
| /* A few ideas for the syntax we should use for asyncronous instantiation: */ | |
| // 1. Pass variable number of constructor arguments and callback as the last argument | |
| var callback = function(instance) { |
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
| # Where "Foobar" is the name I gave my modem under System Preferences > Network | |
| networksetup -connectpppoeservice Foobar |
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
| Hi, Dan; | |
| Patrick and I were discussing how to resolve today's incident, which stemmed from the fact that anything with a ".js" file extension is served from Apache, not Rails, in production. We've got an end point that returns a dynamic provide statement with a bunch of exported data. Looking at it, it's really just a vessel for that exported data. | |
| How would you feel about extending Loadrunner to automatically export requests to JSON endpoints? | |
| Here's (roughly) what we have now: | |
| In the HTML of the page, we include the data file like this: | |
| using('/account/bootstrap_data.js'); |
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 bash | |
| chmod -x ~/workspace/twitter/.git/hooks/pre-commit | |
| git commit $@ | |
| chmod +x ~/workspace/twitter/.git/hooks/pre-commit |
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
| twttr.currentUser.relationshipWith(name, { | |
| success: function(relationship) { | |
| if (canDM) { | |
| that.trigger('dmSuccess', [tweet, that.options.statusAction]); | |
| } else { | |
| error(); | |
| } | |
| }, | |
| error: error | |
| }); |
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
| NSDictionary groupItems(NSArray *items) { | |
| int bucket = 0; | |
| NSDictionary *groupedItems = [NSDictionary alloc]; | |
| id prevItem; | |
| const kItemTimeDistanceThreshold = 30; | |
| [groupedItems setObject:[NSArray alloc] forKey:bucket]; | |
| // I can't remember how to properly iterate in Objective C, | |
| // so let's pretend you can use foreach. |
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
| ?M | |
| M | |
| .$ D? | |
| :M M |
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
| The Rdio app interferes with normal system sleep. I've seen it happen on two unrelated MacBook Pros. | |
| I initially noticed this problem on my own system while working on an app that intentionally delays | |
| system sleep — I thought I had a bug. However, when I tried to track it down, I found that Rdio was | |
| the culprit. Last night, I saw similar behaviour on my girlfriend's computer when she shut the lid | |
| and immediately opened it up again to do something else. Once she'd re-opened it, Chrome wouldn't | |
| make network connections because the system was in the middle of the sleeping process, and 30 seconds | |
| later, it shut off. Rdio was running. | |
| On the Mac, before the system goes to sleep, it gives every app a chance to delay that sleep for up |
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 doSomething() { | |
| // this is the main function | |
| }; | |
| // Style A - shorter, but names don't directly match when they run, which may be confusing | |
| doSomething.after(function() { | |
| // this runs before doSomething | |
| }); |
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
| When you first start off trying to solve | |
| a problem, the first solutions you come | |
| up with are very complex, and most people | |
| stop there. But if you keep going, and | |
| live with the problem and peel more | |
| layers of the onion off, you can often | |
| times arrive at some very elegant and | |
| simple solutions. Most people just | |
| don't put in the time or energy to get | |
| there. We believe that customers are |