Skip to content

Instantly share code, notes, and snippets.


Giovanni Bertoncelli HighSoftWare96

View GitHub Profile
HighSoftWare96 / moleculer-broker-call-mocker.js
Last active Feb 12, 2021 mock services helper function. With this function you can mock services by mocking and returning the desired result for a service that you don't wan't to test right now.
View moleculer-broker-call-mocker.js
function mockBrokerCall(broker, serviceInstance, callSignature, implementationFn) {
if ( {;
const originalImplementation =;
// reimplemento la per verificare se viene chiamata con il servizio
// da mockare e ritornare l'implementazione passata
HighSoftWare96 / OAS3GeneratorNestedAdditionalPropsIssue.json
Last active Mar 5, 2020
OAS3 generator does not correctly implement the nested additionalProperties of this schema.
View OAS3GeneratorNestedAdditionalPropsIssue.json
"openapi": "3.0.0",
"components": {
"responses": {
"200": {
"description": "OK"
"diagnostic200": {
"description": "200 OK",
"content": {
HighSoftWare96 /
Created Feb 13, 2020
Angular prevent page refresh and route deactivation

How to prevent Angular page refresh?

Quick guide about how lock an Angular page both in the Angular route and the browser refresh. Reference:

Component interface: LockableComponent

import { Observable } from "rxjs";
import { HostListener } from "@angular/core";

// see
HighSoftWare96 / swiper-flat-list get current index.js
Created Jan 23, 2019
How to get current index from swiper-flat-list or flat-list in react native.
View swiper-flat-list get current index.js
import React from "react";
import SwiperFlatList from "react-native-swiper-flatlist";
export default class MyComponent extends React.Component {
constructor(props) {
this.currentIndex = 0;
this._updateIndex = this._updateIndex.bind(this);
this.viewabilityConfig = {
HighSoftWare96 /
Last active Sep 5, 2017 — forked from anonymous/
Objs, special methods, imports, files
# import di classi esterne al mio file principale
from module import Book
from module import Dictionary
book = Book("Moby Dick", "Loomings. \
Call me Ishmael. Some years ago—never mind how\
long precisely...", 500)
print("Implementation of special method __len__:")
import math # learn more:
class Email:
sender = "me"
destination = "other"
def send(self):
host = "host"
newMail = Email()