This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
first, create a mydb.js | |
``` | |
var dirty = require('dirty'); | |
let MyDB = class { | |
constructor(dbname) { | |
this.dbname = dbname | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" > | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<!-- Le styles --> | |
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html ng-app="app"> | |
<head> | |
<!-- | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular-resource.min.js"></script> | |
--> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.min.js"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular-resource.min.js"></script> | |
<script type="text/javascript"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://docs.google.com/presentation/d/1dp0GOtvl2-pZoxkyzvGvq5zmPdMIDQIBzr2Vv_3JzQo/pub?start=false&loop=false&delayms=3000#slide=id.gd2fff574_099 | |
// Clients is an interface | |
var Clients = { | |
get : function(id) {}, | |
save : function(client) {}, | |
list : function() {}, | |
msg : function() {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var kue = require('kue') | |
var redis = require('redis') | |
kue.redis.createClient = function () { | |
var client = redis.createClient(); | |
client.select(2, function (status) { | |
console.log(status) | |
}) | |
return client; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html ng-app="myApp"> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script> | |
<script type="text/javascript"> | |
var myApp = angular.module('myApp', [], function ($interpolateProvider) { | |
$interpolateProvider.startSymbol('[['); | |
$interpolateProvider.endSymbol(']]'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
express = require 'express' | |
routes = require './routes' | |
http = require 'http' | |
cons = require 'consolidate' | |
app = express() | |
app.engine 'html', cons.swig | |
app.configure ( -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>untitled</title> | |
<link href='http://twitter.github.com/bootstrap/assets/css/bootstrap.css' | |
rel='stylesheet' type='text/css'> | |
<style type="text/css"> | |
.box2 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
express = require 'express' | |
routes = require './routes' | |
app = module.exports = express.createServer() | |
# Configuration | |
app.configure -> | |
app.set 'views', __dirname + '/views' | |
app.set 'view engine', 'jade' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
express = require('express') | |
routes = require('./routes') | |
app = module.exports = express.createServer() | |
# Configuration | |
app.configure -> | |
app.set 'views', __dirname + '/views' | |
app.set 'view engine', 'jade' |
NewerOlder