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
live server: | |
> hg pull | |
> hg branch | |
default | |
> hg merge develop | |
36 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
(branch merge, don't forget to commit) | |
> hg ci -m "merged develop - should fix the bugs" | |
created new head (!?) |
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
SERVER SIDE: | |
========================= classes/Chess.php ===================== | |
// MODEL ON SERVER | |
class Chess extends Base_Chess // here's one particular table | |
{ | |
function makeMove($e) | |
{ |
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
/** | |
* Mixes in one or more classes. Useful for inheritance and multiple inheritance. | |
* @param A Function | |
* The constructor corresponding to the "class" we are mixing functionality into | |
* This function will get the following members set: | |
* __mixins: an array of [B, C, ...] | |
* constructors(subject, params): a method to call the constructor of all mixing classes, in order. Pass this to it. | |
* staticProperty(property): a method for getting a property name | |
* @param B Function | |
* One or more constructors representing "classes" to mix functionality from |
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
// Illustrative case | |
// YEAH -- ILLUSTRATIVE OF THE FACT THAT YOU CAN ISSUE PARALLEL QUERIES TO THE DATABASE INSTEAD OF SERIAL ONES LIKE A DUMB THREADED IMPLEMENTATION THAT IS INFERIOR FOR DOING WEB SERVERS | |
function (recentBlogPostIds, callback) { // obviously you need this, but use callback instead of return | |
var results = {}; | |
var count = 0; | |
for (var i = 0; i < recentBlogPostIds.length; i++) { | |
var blogPostId = recentBlogPostIds[i]; |
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
// asynchronous version | |
asynchronousCache.get("id:3244", function(err, myThing) { | |
if (myThing == null) { | |
asynchronousDB.query("SELECT * from something WHERE id = 3244", function(err, myThing) { | |
// We now have a thing from DB, do something with result | |
doSomething(myThing); | |
}); | |
} else { | |
// We have a thing from cache, do something with result |
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
This is the most open letter ever. Other authors claim their letters are "open" because you can all read them, but in reality, they are nothing but the rants of one person, which you might not even completely agree with, or will piss you off. | |
By contrast, this letter is truly open and gives you the freedom to fork and modify it. Pissed about Mike Arrington investing? Want to give Richard Stallman some personal advice to stop publicly mentioning conspiracy theories he may or may not believe in? The choice is yours. Simply fork this letter and post it on Hacker News and other places. Track its changes, and see what happens. | |
Anything you wanted to write about lately? | |
--- THE THREE LINES --- | |
This letter is licensed under the GNU Public License. http://www.gnu.org/licenses/gpl.html | |
You may fork it but you must include these three lines exactly as they appear at the bottom of the letter. |
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
/* | |
* Sets up control flows involving multiple callbacks and dependencies | |
* Usage: | |
* var p = Q.pipe(function (params, subjects) { | |
* // arguments that were passed are in params.user, params.stream | |
* // this objects that were passed are in subjects.user, subjects.stream | |
* }, ['user', 'stream]); | |
* mysql("SELECT * FROM user WHERE user_id = 2", p.fill('user')); | |
* mysql("SELECT * FROM stream WHERE publisher_id = 2", p.fill('stream')); | |
* |
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
/* | |
* Creates a callback to be called after multiple functions are done | |
* Usage: | |
* var p = Q.pipe(function (params, subjects) { | |
* // arguments that were passed are in params.user, params.stream | |
* // this objects that were passed are in subjects.user, subjects.stream | |
* }, ['user', 'stream]); | |
* mysql("SELECT * FROM user WHERE user_id = 2", p.fill('user')); | |
* mysql("SELECT * FROM stream WHERE publisher_id = 2", p.fill('stream')); | |
* |
NewerOlder