Skip to content

Instantly share code, notes, and snippets.

View Hogent's full-sized avatar

Karel Van Achte Hogent

View GitHub Profile
@Hogent
Hogent / semantic-markup-example-html4.html
Created December 4, 2012 09:27
Gist for article on HTML5 semantics.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head >
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Page Title | Site Name</title>
<meta name="description" content="page description">
<link rel="stylesheet" href="style.css" type="text/css" media="all">
</head>
<body>
<div id="header">
@Hogent
Hogent / semantic-markup-example-html5.html
Last active December 9, 2015 20:49
Gist for article on HTML5 semantics
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page Title | Site Name</title>
<meta name="description" content="page description">
<link rel="stylesheet" href="style.css">
<!--[if lt IE 9]>
<script src="html5shiv.js"></script>
<![endif]-->
@Hogent
Hogent / valid-html5.html
Created December 18, 2012 14:58
HTML5 Doctype
<!DOCTYPE html><title></title>
@Hogent
Hogent / server.js
Last active December 17, 2015 08:49
Node http server
//server.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(3000, '127.0.0.1');
console.log('Server running at http://127.0.0.1:3000/');
@Hogent
Hogent / helloworld.php
Created May 15, 2013 11:52
php hello world
<?php
echo "Hello World";
@Hogent
Hogent / package.json
Created May 15, 2013 11:55
package.json file
{
"name": "note-app",
"description": "Simple HTML5 Note Application",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "*"
}
}
@Hogent
Hogent / server.js
Created May 15, 2013 11:57
express example
var express = require('express');
var app = express();
app.get('/notes', function(req, res) {
res.send([{note:'note1'}, {note:'note2'}, {note:'note3'}]);
});
app.get('/notes/:id', function(req, res) {
res.send({id:req.params.id, title: "note title", description: "note description"});
});
@Hogent
Hogent / notes.js
Created May 15, 2013 12:00
routes
//routes/notes.js
exports.findAll = function(req, res) {
res.send([{note:'note1'}, {note:'note2'}, {note:'note3'}]);
};
exports.findById = function(req, res) {
res.send({id:req.params.id, title: "note title", description: "note description"});
};
//server.js
var express = require('express'),
notes = require('./routes/notes');
var app = express();
app.get('/notes', notes.findAll);
app.get('/notes/:id', notes.findById);
app.listen(3000);
"dependencies": {
"express": "*",
"mongoose": "*"
}