Chrome 38 Introduces a Responsive Design View

Chrome 38 has introduced a responsive design view in Chrome Developer tools. It allows you to view the available breakpoints for the loaded site. Clicking each of the bars resizes the window to the specified breakpoint or selecting the device will resize the window to that devices resolution.

As well as User Agent spoofing It also introduces network throttling to produce near real device simulations for development.

Chrome version 38 is available in Chrome Canary build.

Capture

Cumberland Psychiatric Hospital

Image

Cumberland Hospital is a public psychiatric hospital located in Westmead, in Sydney’s west. Along with Bungarribee House, Blacktown Hospital it serves the mental health needs of Western Sydney. As a public hospital it is part of Sydney West Area Health Service (SWAHS).

The site was formally the residence of female convicts. Female convicts were housed separately from the male population. In 1817 Governor Macquarie commissioned the building of more permanent structures. Female convicts housed on this site were made to work and the site became known as The Female Factory. The Factory housed unassigned, unmarried female convicts, and their children.

Although transportation of convicts to New South Wales ceased in 1840 the site was maintained as a place for female convicts until 1847.

In 1849 the buildings were redesignated a Lunatic Asylum. The site has remained as a mental health institution to the present day, only taking on its current name in 1983.

In the late 19th century it was the home of inmate William Cresswell, proposed as a candidate in the Tichborne case, who died there in 1904.

Parramatta River
Cumberland Psychiatric Hospital Cumberland Psychiatric Hospital Cumberland Psychiatric Hospital Cumberland Psychiatric Hospital Cumberland Psychiatric Hospital Pool Cumberland Psychiatric Hospital Parramatta River

Basic introduction to Express JS

Express is a web application framework for Node js. I will show you how you can get up and running with express in 5 mins.

First we need nodejs to run the application. You can download this here: http://nodejs.org/

Next you will need to make a new directory where we will put our application.

$ mkdir boom

Go in there and create a package.json file where we will fill out the dependencies of this application. Take note at the express dependency. It’s best to get the latest version of express. You can find this out by going to https://npmjs.org/package/express

{
  "name": "boom",
  "description": "test app",
  "version": "0.0.1",
  "private": true,
  "dependencies": {
    "express": "3.x"
  }
}

After you have created the package.json you will need to install the projects dependencies with the following command in either terminal or command prompt.

$ npm install

You will see there is now a file named node_modules. This is ok. If you are using version control, be sure to add this as an ignored file.

Now we need to make the application. Create the following file: server.js in your project root and open it in a code editor of your choice.

First we create the application with express();

var express = require('express');
var app = express();

Now we define our routes with app.COMMAND. These are like urls the end user will see. You can see the various commands here. We will use the app.GET command in our script. This has two objects that are passed into the function request and response.

app.get('/hello.txt', function(req, res){
	var body = 'Hello World';
	res.setHeader('Content-Type', 'text/plain');
	res.setHeader('Content-Length', body.length);
	res.end(body);
});

You can see here we are sending the response back to the client with res.end(). We are also setting the Content-Type and Content-Length.

(OPTIONAL) We will assign one more route to make this app slightly exciting. Here we are use a request variable and displaying it in the response.


app.get('/user/:username', function(req, res){
        var body = 'Hello ' + req.params.username;
        res.setHeader('Content-Type', 'text/plain');
        res.setHeader('Content-Length', body.length);
        res.end(body);
});

We then use the app.listen method and assign a port.

app.listen(3000);

Save that file and go back to your terminal or command prompt and start your server with the following:

$ node server.js

you can then navigate to the following http://localhost:3000/hello.txt and you will see your site running.

To see the second route we setup goto http://localhost:3000/user/yourname