Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
package nd.financial.fw.subject; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; | |
import java.util.concurrent.TimeUnit; |
@Configuration | |
@ComponentScan(basePackages={"com.dummy.data"}) | |
public class TestDBConfig { | |
@Bean | |
public JdbcTemplate jdbcTemplate() | |
{ | |
return new JdbcTemplate(h2DataSource()); | |
} | |
// interface for Window | |
interface Window { | |
// add some stuff here | |
} | |
let someMockWindowObject = { | |
// add some mock functionality here | |
}; |
package com.javacodegeeks.enterprise.rest.jersey; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import javax.ws.rs.Consumes; | |
import javax.ws.rs.POST; | |
import javax.ws.rs.Path; |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
var express = require('express'); | |
var path = require('path'); | |
var favicon = require('serve-favicon'); | |
var logger = require('morgan'); | |
var cookieParser = require('cookie-parser'); | |
var bodyParser = require('body-parser'); | |
var session = require('express-session'); | |
var validator = require('express-validator'); | |
var csrf = require('csurf'); |
var express = require('express') | |
, mongoskin = require('mongoskin') | |
var app = express() | |
app.use(express.bodyParser()) | |
var db = mongoskin.db('localhost:27017/test', {safe:true}); | |
app.param('collectionName', function(req, res, next, collectionName){ | |
req.collection = db.collection(collectionName) |
var http = require('http'); | |
http.createServer(function(req, res) { | |
var externalReq = http.request({ | |
hostname: "www.google.com", | |
path: "/images/srpr/logo11w.png" | |
}, function(externalRes) { | |
res.setHeader("content-disposition", "attachment; filename=logo.png"); | |
externalRes.pipe(res); | |
}); |
function fun1(){ | |
console.log('fun1 without cllback'); | |
} | |
function fun2(callback){ | |
console.log(callback('fun2 with callback')); | |
} | |
function fun3(callback){ | |
process.nextTick(() => console.log(callback('fun3 with callback + next tick'))); | |
} | |
console.log('1 '); |
const arr = [1,2,3,4,5,6,7,8]; | |
Array.prototype.even = function(){ | |
let r = []; | |
r = this.filter( v => v % 2 == 0 ); | |
return r; | |
} | |
Array.prototype.odd = function(){ | |
let r = []; |