This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(config) { | |
config.set({ | |
// base path that will be used to resolve all patterns (eg. files, exclude) | |
basePath: '', | |
// frameworks to use | |
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | |
frameworks: ['mocha', 'chai'], | |
// Sources. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def monthNameMap = [1L: "MIK", 2L: "PIK", 3L: "CIK"] | |
LocalDate date = LocalDate.now() | |
DateTimeFormatter formatter = new DateTimeFormatterBuilder() | |
.appendPattern("yyyy ") | |
.appendText(ChronoField.MONTH_OF_YEAR, monthNameMap) | |
.toFormatter(Locale.FRENCH) | |
for (int i = 0; i < 12; ++i) { | |
date = date.minusMonths(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compile "org.codehaus.gpars:gpars:1.2.1" | |
import groovyx.gpars.GParsPool | |
... | |
static void main(String[] args) { | |
def aPromises = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<video width="400" height="300" autoplay controls> | |
<source src="video.mp4" type="video/mp4"> | |
</video> | |
<video width="400" height="300" autoplay controls> | |
<source src="video2.mp4" type="video/mp4"> | |
</video> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HTTP module | |
var http = require('http'); | |
// Authentication module. | |
var auth = require('http-auth'); | |
var basic = auth.basic({ | |
realm: "Simon Area.", | |
file: __dirname + "/../data/users.htpasswd" // gevorg:gpass, Sarah:testpass | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Express module. | |
var express = require('express'); | |
// Authentication module. | |
var auth = require('http-auth'); | |
var basic = auth.basic({ | |
realm: "Simon Area.", | |
file: __dirname + "/../data/users.htpasswd" // gevorg:gpass, Sarah:testpass ... | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File backupFile = new File("C:/Users/gevorg/backup.sql"); | |
String[] command = new String[]{"mysqldump ", "-uroot", "-proot", "test"}; | |
ProcessBuilder processBuilder = new ProcessBuilder(Arrays.asList(command)); | |
processBuilder.redirectError(Redirect.INHERIT); | |
processBuilder.redirectOutput(Redirect.to(backupFile)); | |
Process process = processBuilder.start(); | |
process.waitFor(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AtmosphereClient client = ClientFactory.getDefault().newClient(AtmosphereClient.class); | |
RequestBuilder request = client.newRequestBuilder() | |
.uri("ws://127.0.0.1:7070/test") | |
.transport(Request.TRANSPORT.WEBSOCKET); | |
Socket socket = client.create(); | |
socket.on(Event.CLOSE.name(), new Function<String>() { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'), | |
httpProxy = require('http-proxy'); | |
// Authentication module. | |
var auth = require('../lib/http-auth'); | |
var basic = auth.basic({ | |
realm: "Simon Area." | |
}, function (username, password, callback) { // Custom authentication method. | |
callback(username === "Tina" && password === "Bullock"); | |
} |