Skip to content

Instantly share code, notes, and snippets.

View vdurmont's full-sized avatar

Vincent Durmont vdurmont

View GitHub Profile
extends layout
block content
p Happy to see you again, #{name} !
p I'm happy to show your reversed name: <strong>#{reversedName}</strong>!
{
"name": "MyApp",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "3.4.4",
"jade": "0.35.0"
}
}
@vdurmont
vdurmont / app.js
Last active December 27, 2015 17:09
Basic Express app
var express = require('express');
var app = express();
app.get('/', function(req, res){
var name = req.query.name != null ? req.query.name : "World";
res.send('Hello, '+name+'!');
});
app.listen(3333);
console.log('Running on port 3333!');
@vdurmont
vdurmont / package.json
Last active December 27, 2015 17:09
Basic package.json to import Express in a node project
{
"name": "MyApp",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "3.4.4"
}
}
@vdurmont
vdurmont / jsonp-callback.html
Last active August 29, 2015 14:06
How to use JSONP with userinfo.io API
<!DOCTYPE html>
<html lang="en">
<head>
<title>UserInfo.io — JSONP callback</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript">
function userinfoCallback(data) {
console.log("I can now do awesome things with this beautiful data I just received!");
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else {
root.Hello = factory();
}
}(this, function() {
return function() {
var done = false;
return {