Skip to content

Instantly share code, notes, and snippets.

View bajtos's full-sized avatar

Miroslav Bajtoš bajtos

View GitHub Profile
@bajtos
bajtos / debug.log
Last active May 28, 2020 09:53
typescript-eslint out of memory
This file has been truncated, but you can view the full file.
2020-05-28T09:47:15.118Z loopback:build /Users/bajtos/src/loopback/next/.eslintrc.js found
2020-05-28T09:47:15.119Z loopback:build /Users/bajtos/src/loopback/next/.eslintignore found
2020-05-28T09:47:15.119Z loopback:build Trying to resolve CLI module 'eslint' from /Users/bajtos/src/loopback/next
2020-05-28T09:47:15.120Z loopback:build Resolved CLI module 'eslint': /Users/bajtos/src/loopback/next/node_modules/eslint/bin/eslint.js
2020-05-28T09:47:15.120Z loopback:build /Users/bajtos/src/loopback/next/node_modules/eslint/bin/eslint.js -c /Users/bajtos/src/loopback/next/.eslintrc.js --ignore-path /Users/bajtos/src/loopback/next/.eslintignore --ext .js,.ts --report-unused-disable-directives --cache .
2020-05-28T09:47:15.120Z loopback:build Spawn /usr/local/bin/node /Users/bajtos/src/loopback/next/node_modules/eslint/bin/eslint.js -c /Users/bajtos/src/loopback/next/.eslintrc.js --ignore-path /Users/bajtos/src/loopback/next/.eslintignore --ext .js,.ts --report-unused-disable-directives --cache .
2020-05-28T09:47:1
@bajtos
bajtos / bench-output.txt
Last active June 2, 2020 08:55
Benchmark of generating unique IDs
== BEFORE ==
counter variable len: 24575-1
counter fixed length: 24575-0000000002
uuid v1: 60841ff0-a3f8-11ea-8da7-c5c2ea413f33
uuid v4: 767992e9-caa4-4e51-b694-2d7f0f85a7b1
hyperid variable len: D0TU/ybLT6u5DxndKGF2hg/0
hyperid fixed length: +OBh7XGXRsOViCS5XcghsQ/0000000000
== BENCHMARK ==
counter variable len: x 11,095,695 ops/sec ±1.50% (87 runs sampled)
@bajtos
bajtos / db.datasource.ts
Last active August 8, 2020 20:35
How to intercept LoopBack connector's execute method to implement retry mechanism
@lifeCycleObserver('datasource')
export class DbDataSource extends juggler.DataSource
implements LifeCycleObserver {
static dataSourceName = 'db';
static readonly defaultConfig = config;
constructor(
@inject('datasources.config.db', {optional: true})
dsConfig: object = config,
) {
@bajtos
bajtos / todo.md
Created September 18, 2020 14:38
Random ideas for LoopBack
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreicng44yb7qyg6zrtvdspdgein7ayd5o2qigyifyo5fg4br5e5vuv4 ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@bajtos
bajtos / test.js
Created March 19, 2021 08:57
LoopBack datasource test
'use strict';
// Make sure to `npm install loopback-datasource-juggler`
const juggler = require('loopback-datasource-juggler');
const ds = new juggler.DataSource({
connector: 'memory', // replace with 'oracle'
// additional connector config - hostname, database, credentials, etc.
});
/* Code generated by cmd/cgo; DO NOT EDIT. */
/* package main */
#line 1 "cgo-builtin-export-prolog"
#include <stddef.h>
#ifndef GO_CGO_EXPORT_PROLOGUE_H