Skip to content

Instantly share code, notes, and snippets.

View leon19's full-sized avatar

Lorens León leon19

View GitHub Profile
export type Path = string | number;
const maskedSym: unique symbol = Symbol('masked');
export class Masked {
readonly [maskedSym] = true;
constructor(readonly value: unknown) {}
}
@leon19
leon19 / .versionrc
Last active May 30, 2020 18:07
standard-relase-with-python-poetry
{
"scripts": {
"postchangelog": "bash ./postchangelog.sh"
},
"commitUrlFormat": "{{host}}/{{owner}}/{{repository}}/commits/{{hash}}",
"compareUrlFormat": "{{host}}/{{owner}}/{{repository}}/branches/compare/{{currentTag}}%0D{{previousTag}}#diff",
"bumpFiles": [
{
"filename": "project/__init__.py",
"updater": "./bump-init-version.js"
Creating virtualenv test-pkg in /tmp/test/.venv
Using virtualenv: /tmp/test/.venv
Updating dependencies
Resolving dependencies...
1: fact: test-pkg is 1.0.0
1: derived: test-pkg
0: Duplicate dependencies for guildai
0: Merging requirements for guildai (*)
1: fact: test-pkg depends on guildai (*)
1: fact: test-pkg depends on guildai (*)
const _ = require('lodash');
const { Suite } = require('benchmark');
let highlights = undefined;
console.log('generating data...');
function cellMatchesTerm(term, cell) {
return cell.id === term.id;
}
@leon19
leon19 / server.js
Last active April 20, 2018 06:21
Node.js leak example
// https://stackoverflow.com/questions/11969062/tool-to-track-down-javascript-memory-leak/12061206#12061206
// https://www.dynatrace.com/news/blog/understanding-garbage-collection-and-hunting-memory-leaks-in-node-js/
// https://marmelab.com/blog/2018/04/03/how-to-track-and-fix-memory-leak-with-nodejs.html
const http = require('http');
const hostname = '127.0.0.1';
const port = 0;
const access = [];
{
// Utilizar IntelliSense para aprender acerca de los posibles atributos.
// Mantenga el puntero para ver las descripciones de los existentes atributos
// Para más información, visite: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Current TS File",
"type": "node",
"request": "launch",