Skip to content

Instantly share code, notes, and snippets.

Gábor Soós blacksonic

Block or report user

Report or block blacksonic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@blacksonic
blacksonic / package.json
Created Apr 3, 2018
All the new things: setting up Webpack 4 with Babel 7 - part 6
View package.json
{
"scripts": {
"start": "webpack-dev-server --mode=development",
"test": "karma start --single-run",
"build": "webpack --mode=production"
}
}
@blacksonic
blacksonic / karma.conf.js
Last active Apr 3, 2018
All the new things: setting up Webpack 4 with Babel 7 - part 5
View karma.conf.js
module.exports = (config) => {
config.set({
frameworks: ['jasmine'],
files: [
{ pattern: 'src/test.js' }
],
preprocessors: {
'src/test.js': ['webpack']
@blacksonic
blacksonic / webpack.config.js
Created Apr 3, 2018
All the new things: setting up Webpack 4 with Babel 7 - part 4
View webpack.config.js
'use strict';
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
@blacksonic
blacksonic / index.html
Created Apr 3, 2018
All the new things: setting up Webpack 4 with Babel 7 - part 3
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Webpack Showcase</title>
</head>
<body></body>
</html>
@blacksonic
blacksonic / webpack.config.js
Created Apr 3, 2018
All the new things: setting up Webpack 4 with Babel 7 - part 2
View webpack.config.js
'use strict';
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
plugins: [
new HtmlWebpackPlugin({
template: 'src/index.html'
})
]
@blacksonic
blacksonic / package.json
Last active Apr 3, 2018
All the new things: setting up Webpack 4 with Babel 7 - part 1
View package.json
{
"scripts": {
"start": "webpack --mode=development",
"build": "webpack --mode=production"
}
}
@blacksonic
blacksonic / packages.js
Created Feb 14, 2018
Logging in microservices - part 3
View packages.js
const Koa = require('koa');
const clsAdapter = require('@emartech/cls-adapter');
const LogFactory = require('@emartech/json-logger');
LogFactory.configure({
transformers: [
clsAdapter.addContextStorageToInput()
]
});
const app = new Koa();
@blacksonic
blacksonic / koa.js
Last active Feb 3, 2018
Logging in microservices - part 2
View koa.js
'use strict';
const Koa = require('koa');
const als = require('async-local-storage');
const uuid = require('uuid/v4');
const axios = require('axios');
const app = new Koa();
als.enable();
@blacksonic
blacksonic / async_hooks.js
Created Jan 29, 2018
Logging in microservices - part 1
View async_hooks.js
const async_hooks = require('async_hooks');
const asyncHook = async_hooks.createHook({
init: function(asyncId, type, triggerAsyncId, resource) {},
before: function(asyncId) {},
after: function(asyncId) {},
destroy: function(asyncId) {}
});
asyncHook.enable();
@blacksonic
blacksonic / observable-promise.js
Last active Sep 18, 2019
Clarifying Observables - part 6
View observable-promise.js
promise
.then(value => value + 5)
.then(value => Promise.resolve(9));
observable.pipe(
map(value => value + 5),
flatMap(value => Rx.Observable.of(9)),
filter(value => value > 5)
);
You can’t perform that action at this time.