Clone and build Node for analysis:
$ git clone https://github.com/joyent/node.git
$ cd node
$ export GYP_DEFINES="v8_enable_disassembler=1"
$ ./configure
$ make -j4
| exports.handler = (event, context, callback) => { | |
| const response = { | |
| statusCode: 301, | |
| headers: { | |
| Location: 'https://google.com', | |
| } | |
| }; | |
| return callback(null, response); | |
| } |
| # Hello, and welcome to makefile basics. | |
| # | |
| # You will learn why `make` is so great, and why, despite its "weird" syntax, | |
| # it is actually a highly expressive, efficient, and powerful way to build | |
| # programs. | |
| # | |
| # Once you're done here, go to | |
| # http://www.gnu.org/software/make/manual/make.html | |
| # to learn SOOOO much more. |
| #!/bin/sh | |
| #ID='A16FF353-8441-459E-A50C-B071F53F51B7' # Xcode 6.2 | |
| ID='992275C1-432A-4CF7-B659-D84ED6D42D3F' # Xcode 6.3 | |
| PLIST_BUDDY=/usr/libexec/PlistBuddy | |
| function add_compatibility() { | |
| "$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \ | |
| "$1/Contents/Info.plist" |
| angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) { | |
| $httpProvider.responseInterceptors.push([ | |
| '$q', '$templateCache', 'activeProfile', | |
| function($q, $templateCache, activeProfile) { | |
| // Keep track which HTML templates have already been modified. | |
| var modifiedTemplates = {}; | |
| // Tests if there are any keep/omit attributes. | |
| var HAS_FLAGS_EXP = /data-(keep|omit)/; |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
| <CORSRule> | |
| <AllowedOrigin>*</AllowedOrigin> | |
| <AllowedMethod>GET</AllowedMethod> | |
| <AllowedMethod>POST</AllowedMethod> | |
| <AllowedMethod>PUT</AllowedMethod> | |
| <MaxAgeSeconds>3000</MaxAgeSeconds> | |
| <AllowedHeader>*</AllowedHeader> | |
| </CORSRule> |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.| // includes bindings for fetching/fetched | |
| var PaginatedCollection = Backbone.Collection.extend({ | |
| initialize: function() { | |
| _.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
| typeof(options) != 'undefined' || (options = {}); | |
| this.page = 1; | |
| typeof(this.perPage) != 'undefined' || (this.perPage = 10); | |
| }, | |
| fetch: function(options) { |