Skip to content

Instantly share code, notes, and snippets.

@mefernandez
mefernandez / Employee.java
Created December 2, 2016 11:12
Spring Data's Page and @JSONVIEW solution
@Entity
public class Employee {
@Id
@GeneratedValue
private Long id;
@JsonView(SummaryView.class)
private String name;
@mefernandez
mefernandez / code.js
Created October 9, 2014 18:52
A sample gist posted from NinjaCoder.be
This is the code
@mefernandez
mefernandez / code.js
Created October 9, 2014 18:50
A sample gist posted from NinjaCoder.be
This is the code
describe('A function',function(){
it('extracts the simmetric difference of two arrays of integers',function(){
expect(diff([1,2,3], [4,5,6])).toEqual([1,2,3,4,5,6]);
expect(diff([1,2,3], [1,2,3])).toEqual([]);
expect(diff([1], [])).toEqual([1]);
expect(diff([1], [2])).toEqual([1,2]);
expect(diff([1,2,3], [1,2,3,4])).toEqual([4]);
});
describe('A function',function(){
it('extracts the simmetric difference of two arrays of integers',function(){
expect(diff([1,2,3], [4,5,6])).toEqual([1,2,3,4,5,6]);
expect(diff([1,2,3], [1,2,3])).toEqual([]);
expect(diff([1], [])).toEqual([1]);
expect(diff([1], [2])).toEqual([1,2]);
expect(diff([1,2,3], [1,2,3,4])).toEqual([4]);
});
@mefernandez
mefernandez / app.js
Last active December 24, 2015 16:38
A Mocha test to find out what's the problem with Rewire and Express apps.
var express = require('express');
var app = express();
function sayHello(req, res) {
res.send(200, 'Hello!');
res.end();
}
// all environments
app.set('port', process.env.PORT || 3000);