Mocha is a unittest framework for Node. In this document, we explain how you can test your javascript code and also your HTTP servers.
Use npm
to install Mocha:
npm install mocha
Mocha is a unittest framework for Node. In this document, we explain how you can test your javascript code and also your HTTP servers.
Use npm
to install Mocha:
npm install mocha
Install Guide: | |
1. Download Rabbit MQ Server from | |
https://www.rabbitmq.com/download.html | |
2. Install the RabbitMQ Server | |
3. Open Console (set environment variable or open RabbitMQ CMD) and run the following command | |
rabbitmq-plugins enable rabbitmq_management |
The following snippets show some common Markdown mistakes.
Click the Raw
button to see the source text and understand the author's intent.
GitHub's parser handles some of these cases; other parsers do not.
To catch these problems automatically:
(function( $ ) { | |
$.fn.photoswipe = function(options){ | |
var galleries = [], | |
_options = options; | |
var init = function($this){ | |
galleries = []; | |
$this.each(function(i, gallery){ | |
galleries.push({ | |
id: i, |
var express = require('express'), | |
app = express(); | |
app.listen(80); | |
app.get('/', function(req, res){ | |
var ua = req.header('user-agent'); | |
// Check the user-agent string to identyfy the device. | |
if(/mobile|iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile|ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(ua)) { | |
res.sendfile(__dirname + '/mobile.html'); | |
} else { | |
res.sendfile(__dirname + '/index.html'); |
package springbatch; | |
import common.Greeting; | |
import org.springframework.batch.core.Job; | |
import org.springframework.batch.core.Step; | |
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; | |
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; | |
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; | |
import org.springframework.batch.core.launch.JobLauncher; | |
import org.springframework.batch.core.launch.support.SimpleJobLauncher; |
sudo yum update
##Install Redis https://gist.github.com/dstroot/2776679
wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
chmod 777 install-redis.sh
./install-redis.sh
alias ng="npm list -g --depth=0 2>/dev/null" | |
alias nl="npm list --depth=0 2>/dev/null" |
app.post('/login', function(req, res) { | |
console.log(res); | |
passport.authenticate('local', function(err, user) { | |
if (req.xhr) { | |
//thanks @jkevinburton | |
if (err) { return res.json({ error: err.message }); } | |
if (!user) { return res.json({error : "Invalid Login"}); } | |
req.login(user, {}, function(err) { | |
if (err) { return res.json({error:err}); } | |
return res.json( |
require 'tire' | |
# Tire.configure { logger STDERR, level: 'debug' } | |
Tire.index('movie-titles') do | |
delete | |
create \ | |
settings: { | |
index: { | |
analysis: { |