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 / 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)
);
@blacksonic
blacksonic / response.json
Created Sep 5, 2019
Codeship create project response
View response.json
{
"project": {
"uuid": "09c72ed0-b240-0137-747f-064feeba253d",
"id": 363332,
"name": "emartech/test-example-app",
"type": "basic",
"repository_url": "https://github.com/emartech/test-example-app",
"repository_provider": "github",
"authentication_user": null,
"organization_uuid": "f64f7300-e93d-0133-b53e-76bef8d7b14f",
@blacksonic
blacksonic / payload.json
Created Sep 5, 2019
Codeship create project payload
View payload.json
{
"repository_url": "git@github.com:emartech/test-example-app.git",
"type": "basic",
"setup_commands": [
"npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN",
"npm install"
],
"test_pipelines": [
{
"name": "test",
@blacksonic
blacksonic / dynamic.mjs
Created Jun 15, 2019
The complete ES module upgrade guide - part 8
View dynamic.mjs
// index.js
function main() {
import('./module')
.then(({ sum }) => {
console.log(sum(1, 2));
});
}
main();
// module.js
@blacksonic
blacksonic / dynamic.cjs
Created Jun 15, 2019
The complete ES module upgrade guide - part 7
View dynamic.cjs
// index.js
function main() {
const { sum } = require('./module');
console.log(sum(1, 2));
}
main();
// module.js
module.exports.sum = (a, b) => a + b;
@blacksonic
blacksonic / binding.mjs
Created Jun 15, 2019
The complete ES module upgrade guide - part 6
View binding.mjs
// index.js
import { counter, increment } from './module';
console.log(counter);
increment();
console.log(counter);
// module.js
export let counter = 0;
export const increment = () => {
@blacksonic
blacksonic / binding.cjs
Created Jun 15, 2019
The complete ES module upgrade guide - part 5
View binding.cjs
// index.js
const { counter, increment } = require('./module');
console.log(counter);
increment();
console.log(counter);
// module.js
module.exports.counter = 0;
module.exports.increment = () => {
@blacksonic
blacksonic / execution-order.mjs
Created Jun 15, 2019
The complete ES module upgrade guide - part 4
View execution-order.mjs
// index.js
console.log('loading module');
import './module.js';
console.log('module loaded');
// module.js
console.log('hello from module');
// hello from module
// loading module
@blacksonic
blacksonic / execution-order.cjs
Created Jun 15, 2019
The complete ES module upgrade guide - part 3
View execution-order.cjs
// index.js
console.log('loading module');
require('./module.js');
console.log('module loaded');
// module.js
console.log('hello from module');
// loading module
// hello from module
@blacksonic
blacksonic / named-exports.cjs
Last active Jun 13, 2019
The complete ES module upgrade guide - part 1
View named-exports.cjs
// NAMED EXPORT
// index.js
const { sum } = require('./module');
console.log(sum(1, 2));
// module.js
module.exports.sum = (a, b) => a + b;
// DEFAULT EXPORT
You can’t perform that action at this time.