Run with:
-javaagent:/Users/tom/.m2/repository/org/springframework/spring-instrument/4.1.4.RELEASE/spring-instrument-4.1.4.RELEASE.jar
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
define(['underscore' | |
], function (_) { | |
'use strict'; | |
describe('a spy', function () { | |
console.log('settings check in <<<'); | |
var foo, bar = null; | |
beforeEach(function () { |
var mock = function (constr, name) { | |
var HelperConstr = function(){}; | |
HelperConstr.prototype = constr.prototype; | |
var result = new HelperConstr(); | |
for (var key in constr.prototype) { | |
try { | |
if (constr.prototype[ key ] instanceof Function) { | |
result[ key ] = jasmine.createSpy(( name || 'mock' ) + '.' + key); | |
} | |
} catch (ex) { |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target({ElementType.METHOD}) | |
public @interface RunInThread { | |
} |
var gulp = require('gulp'), | |
del = require('del'), | |
plugins = require('gulp-load-plugins')(), | |
bower = require('main-bower-files'), | |
source = require('vinyl-source-stream'), | |
buffer = require('vinyl-buffer'), | |
browserify = require('browserify'), | |
browserSync = require('browser-sync'); | |
var conf = { |
var child_process = require('child_process'); | |
// exec: spawns a shell. | |
child_process.exec('ls -lah /tmp', function(error, stdout, stderr){ | |
console.log(stdout); | |
}); | |
// execFile: executes a file with the specified arguments | |
child_process.execFile('ls', ['-lah', '/tmp'], function(error, stdout, stderr){ | |
console.log(stdout); |
function xhr(options) { | |
var deferred = Q.defer(), | |
req = new XMLHttpRequest(); | |
req.open(options.method || 'GET', options.url, true); | |
// Set request headers if provided. | |
Object.keys(options.headers || {}).forEach(function (key) { | |
req.setRequestHeader(key, options.headers[key]); | |
}); |
Run with:
-javaagent:/Users/tom/.m2/repository/org/springframework/spring-instrument/4.1.4.RELEASE/spring-instrument-4.1.4.RELEASE.jar
If you do not have an oracle driver do steps 1 and 2 first. Otherwise skip to step 3. | |
1) Download the jdbc driver from oracle. | |
2) Install the driver into your local maven .m2 repository. Example: | |
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.4 -Dpackaging=jar -Dfile=ojdbc6.jar -DgeneratePom=true | |
In the above example the ojdbc6.jar version 11.2.0.4 is used. Replace the -DartifactId=ojdbc6 -Dversion=11.2.0.4 and -Dfile=ojdbc6.jar with the driver name/version you downloaded. |