Skip to content

Instantly share code, notes, and snippets.

View DataLayerReceiver.js
function DataLayerReceiver(callBack) {
this.dataLayerByName = [];
this.callBack = callBack;
}
DataLayerReceiver.prototype.emit = function (publisherName, publisherData) {
console.log('emit from ', publisherName);
var complete = true;
for (var i = 0; i < this.dataLayerByName.length; i++) {
View test.js
// test DOMContentLoaded
console.log('parse test.js from gits'+(+new Date));
var pubpubExt = t1.attach("pubExt");
setTimeout(function () {
pubpubExt("emit pubpubExt");
}, 1000);
View MyLogError
[ERROR] Failed to execute goal org.owasp:dependency-check-maven:1.4.5:check (default-cli) on project backend-app: Execution default-cli of goal org.owasp:dependency-check-maven:1.4.5:check failed: A required class was missing while executing org.owasp:dependency-check-maven:1.4.5:check: org/joda/time/ReadableInstant
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.owasp:dependency-check-maven:1.4.5
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/D:/outils/m2repository/org/owasp/dependency-check-maven/1.4.5/dependency-check-maven-1.4.5.jar
[ERROR] urls[1] = file:/D:/outils/m2repository/org/owasp/dependency-check-core/1.4.5/dependency-check-core-1.4.5.jar
[ERROR] urls[2] = file:/D:/outils/m2repository/joda-time/joda-time/1.6/joda-time-1.6.jar
[ERROR] urls[3] = file:/D:/outils/m2repository/org/apache/commons/commons-compress/1.13/commons-compress-1.13.jar
[ERROR] urls[4] = file:/D:/outils/m2repository/commons-io/comm
@asicfr
asicfr / Test.java
Created Jun 1, 2016
The distinction between hiding and overriding method
View Test.java
class A {
public static void display() {
System.out.println("Inside static method of superclass");
}
}
class B extends A {
public void show() {
display();
}
@asicfr
asicfr / TestClass.java
Created May 2, 2016
Properties and ResourceBundle from Xml file
View TestClass.java
package test;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.ResourceBundle;
public class TestClass {
@asicfr
asicfr / index.js
Last active Aug 29, 2015 — forked from juliangruber/index.js
requirebin sketch
View index.js
var unique = require('uniq');
var data = [1, 2, 2, 3, 4, 5, 5, 5, 6];
console.log(unique(data));
View gist:b4f698b8a253bac5bc6f
var unique = require('uniq');
var data = [1, 2, 2, 3, 4, 5, 5, 5, 6];
console.log(unique(data));
View service deferred
var myService = function($http, $q, $timeout) {
this.doItAsync = function() {
var deferred = $q.defer();
...
return deferred.promise;
};
};
angular.module('global.services', []);
myService.$inject = ['$http', '$q', '$timeout'];
View ctrl example
(function () {
angular.module('myApp', []);
var myCtrl = function ($scope) {
console.log("declare myCtrl");
$scope.itWasUsed = false;
$scope.myvalue = 'value initial';
$scope.useIt = function () {
console.log("call real useIt function");
$scope.itWasUsed = true;
View template jasmine for angularjs
<!DOCTYPE html>
<html>
<head>
<script src="http://jasmine.github.io/2.0/lib/jasmine.js" type="text/javascript">
<script src="http://jasmine.github.io/2.0/lib/jasmine-html.js" type="text/javascript">
<script src="http://jasmine.github.io/2.0/lib/boot.js" type="text/javascript">
<link href="http://jasmine.github.io/2.0/lib/jasmine.css" type="text/css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular.js" type="text/javascript">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular-mocks.js" type="text/javascript">
<!-- add your js resources here -->
You can’t perform that action at this time.