Skip to content

Instantly share code, notes, and snippets.

View HighSoftWare96's full-sized avatar

Giovanni Bertoncelli HighSoftWare96

View GitHub Profile
HighSoftWare96 / moleculer-broker-call-mocker.js
Last active February 12, 2021 01:35 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.
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 March 5, 2020 09:32
OAS3 generator does not correctly implement the nested additionalProperties of this schema.
"openapi": "3.0.0",
"components": {
"responses": {
"200": {
"description": "OK"
"diagnostic200": {
"description": "200 OK",
"content": {
HighSoftWare96 /
Created February 13, 2020 09:58
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 January 23, 2019 14:09
How to get current index from swiper-flat-list or flat-list in react native.
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 September 5, 2017 14:53 — 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__:")
HighSoftWare96 /
Created August 31, 2017 16:35 — forked from anonymous/
null created by anonymous -
import math # learn more:
class Email:
sender = "me"
destination = "other"
def send(self):
host = "host"
newMail = Email()