##Using libuv and http-parser to build a webserver
Ryan Dahl, @ryah
http://vimeo.com/24713213
Source, Part I: http://t.co/utoIM93
Source, Part II: http://bit.ly/iBgnIA
##Node.js on windows
Bert Belder
http://2bs.nl/nodecamp.pdf
| var resourcer = require("resourcer"); | |
| resourcer.connect({ | |
| port: 5984, | |
| uri: "database://website" | |
| }); | |
| exports.Account = resourcer.define("account", function() { | |
| this.property("type"); | |
| this.property("name"); |
##Using libuv and http-parser to build a webserver
Ryan Dahl, @ryah
http://vimeo.com/24713213
Source, Part I: http://t.co/utoIM93
Source, Part II: http://bit.ly/iBgnIA
##Node.js on windows
Bert Belder
http://2bs.nl/nodecamp.pdf
| <?php | |
| /** | |
| * Send HTTP request to "fliplife.com" and return the HTTP status. | |
| * | |
| * @param array $headers Associative array with HTTP request headers. | |
| * @throws Exception If no HTTP status can be found. | |
| * @return integer HTTP status. | |
| */ | |
| function requestFliplife(array $headers) |
| /* | |
| * jQuery Plugin: Tokenizing Autocomplete Text Entry | |
| * Version 1.6.0 | |
| * | |
| * Copyright (c) 2009 James Smith (http://loopj.com) | |
| * Licensed jointly under the GPL and MIT licenses, | |
| * choose which one suits your project best! | |
| * | |
| */ |
| $ elixir -v | |
| Elixir 0.10.0 | |
| $ erl | |
| Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] | |
| Eshell V5.10.2 (abort with ^G) | |
| 1> |
| $ iex --erl "-boot start_sasl" --sname a --cookie dummy -S mix | |
| Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] | |
| =PROGRESS REPORT==== 30-Jul-2013::10:41:03 === | |
| supervisor: {local,sasl_safe_sup} | |
| started: [{pid,<0.42.0>}, | |
| {name,alarm_handler}, | |
| {mfargs,{alarm_handler,start_link,[]}}, |
| $ iex --erl "-boot start_sasl" --sname a --cookie dummy -S mix | |
| Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] | |
| =PROGRESS REPORT==== 30-Jul-2013::10:41:03 === | |
| supervisor: {local,sasl_safe_sup} | |
| started: [{pid,<0.42.0>}, | |
| {name,alarm_handler}, | |
| {mfargs,{alarm_handler,start_link,[]}}, |
| #!/bin/sh -e | |
| # | |
| # Original File Location: | |
| # /etc/init.d/couchdb | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
| # use this file except in compliance with the License. You may obtain a copy of | |
| # the License at |
| var fs = require("fs"); | |
| function read(fd) { | |
| var buf = new Buffer(8); | |
| fs.read(fd, buf, 0, buf.length, null, function () { | |
| console.log(buf); | |
| read(fd); | |
| }); | |
| } |
| var util = require("util") | |
| , fs = require("fs"); | |
| exports.create = function () { | |
| var b = new Bar(); | |
| b.bla(); | |
| }; | |
| var Bar = function () {}; |