Skip to content

Instantly share code, notes, and snippets.

View tzkmx's full-sized avatar
🎉
estrenando repositorios privados

Jesus Franco tzkmx

🎉
estrenando repositorios privados
View GitHub Profile
@tzkmx
tzkmx / DisposableStack.ts
Created September 13, 2023 05:22
Polyfill to use DisposableStack in Node16
class DisposableStack {
constructor() {
if (!(this instanceof DisposableStack)) {
throw new TypeError('DisposableStack must be constructed with new');
}
this.#state = 'pending';
this.#disposeCapability = newDisposeCapability();
}
get disposed() {
@tzkmx
tzkmx / in.md
Created September 7, 2023 23:31
Example of logger using DI with awilix

Notable example of Dependency Injection and use of FileTransports discussed in awilix issues

jeffijoe/awilix#128

@tzkmx
tzkmx / auth.js
Created August 23, 2023 21:17 — forked from mrpinghe/auth.js
Veracode custom HMAC request signing algorithm (used for API authorization)
var crypto = require('crypto');
const id = process.env.API_ID; // your API ID, reading from environment variable
const key = process.env.KEY; // your API key, reading from environment variable
const preFix = "VERACODE-HMAC-SHA-256";
const verStr = "vcode_request_version_1";
var resthost = "api.veracode.com"; // rest host
var xmlhost = "analysiscenter.veracode.com"; // xml host
@tzkmx
tzkmx / instructions.md
Created April 14, 2023 02:25
Script to split by chapters and convert audible to mp3.

Easy use

You use this script passing:

  • as first argument the input file
  • second argument is the content code

You can get your activation_bytes or content code from this site:

https://audible-converter.ml/

@tzkmx
tzkmx / PageObject.py
Last active February 10, 2023 16:53
ejemplos de pageObject con ChatGPT
class PageObject:
def __init__(self, driver):
self.driver = driver
def takeScreenshot(self):
# Código para tomar una captura de pantalla
pass
def checkTitle(self, expectedTitle):
self.takeScreenshot()
@tzkmx
tzkmx / cursor_update.sql
Created August 30, 2022 17:17
Cursor Mysql update row by row
DELIMITER $$
CREATE PROCEDURE fixVersionAggregate ()
BEGIN
DECLARE finished INTEGER DEFAULT 0;
DECLARE evId BIGINT DEFAULT 0;
DECLARE evVersion INT DEFAULT 0;
-- declare cursor for
DEClARE curEvent
CURSOR FOR
@tzkmx
tzkmx / README.md
Created June 30, 2022 09:27 — forked from vanushwashere/README.md
Systemd unit file for supervisord service

Systemd unit file for supervisord service

  • place this config in /etc/systemd/system/supervisord.service
  • kill all supervisord processes
  • sudo systemctl daemon-reload
  • sudo systemctl enable supervisord
  • start with sudo systemctl start supervisord if already not started
@tzkmx
tzkmx / sentry-serverless-firebase.ts
Created February 18, 2022 04:49 — forked from zanona/sentry-serverless-firebase.ts
Missing Sentry's firebase serverless wrappers
/**
* Temporary wrapper for firebase functions until @sentry/serverless support is implemented
* It currently supports wrapping https, pubsub and firestore handlers.
* usage: https.onRequest(wrap((req, res) => {...}))
*/
import type {Event} from '@sentry/types';
import type {https} from 'firebase-functions';
import type {onRequest, onCall} from 'firebase-functions/lib/providers/https';
import type {ScheduleBuilder} from 'firebase-functions/lib/providers/pubsub';
import type {DocumentBuilder} from 'firebase-functions/lib/providers/firestore';
@tzkmx
tzkmx / createFund.ts
Last active December 21, 2021 20:29
Correct? reuse of model event creator in machine (xstate)
// https://stately.ai/viz/8cf34aba-b602-4f85-93d2-cc4c2d1f4c06
import { createModel } from 'xstate/lib/model'
interface Fund {
label: string
$target: number
createdAt: Date
updatedAt: Date
}
@tzkmx
tzkmx / script.sh
Created December 9, 2021 07:46
Split commits with git rebase
## Source: https://emmanuelbernard.com/blog/2014/04/14/split-a-commit-in-two-with-git/
### Split a commit in two for the busy onesPermalink
### Let’s see the sequence first before explaining it
git rebase -i <oldsha1>
# mark the expected commit as `edit` (replace pick in front of the line), save and close
git reset HEAD^
git add ...
git commit -m "First part"