Skip to content

Instantly share code, notes, and snippets.

View hmanzur's full-sized avatar
:octocat:
Github Actions Hachathon 2020 Winner

Habid Enrique Manzur Restrepo hmanzur

:octocat:
Github Actions Hachathon 2020 Winner
View GitHub Profile
@hmanzur
hmanzur / loader.svg
Last active November 20, 2024 16:56
Asincode Loader
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hmanzur
hmanzur / useDocumentMeta.js
Last active November 15, 2024 14:28
Manipulate HTML meta, title and links in components
import { useEffect } from 'react';
/**
* Custom hook to manage the document's title, meta tags, and link tags.
* @param {string} title - The new title for the document.
* @param {Array} metas - An array of meta tag objects with { key, props, value }.
* @param {Array} links - An array of link tag objects with { rel, href }.
*/
const useDocumentMeta = (title, metas = [], links = []) => {
useEffect(() => {
@hmanzur
hmanzur / 00_Bases.md
Last active April 27, 2023 20:17
DevOps Roadmap 2023

Bases DevOps

  • Principios DevOps
  • Bases en algún lenguaje de programación (Python / Typescript / Go / Java)
  • Manejo de herramientas de CI / CD (Github Actions / Repository Pipelines / Cloud Pipelines / Circle CI)
  • Infraestructura como código (Terraform / Pulumi / Cloud SDK)
  • Unix (Bash scripting, Linux, comandos más usados)
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |
# File that contains failures.
failure_file=failure.log
touch ${failure_file}
for d in portal/*/; do
@hmanzur
hmanzur / 00_Bases.md
Last active May 12, 2021 17:47
JS Roadmap 2021

Bases del lenguaje

  • Asignación, variables y tipos
  • Condicionales y operadores
  • Arrays y ciclos
  • Funciones
  • Callbacks
@hmanzur
hmanzur / es6-spreadsheet-parser.js
Last active February 23, 2021 14:38
Es6 promisify xlsx parser
/**
* Convert Spreadsheet to array using XLSX library and es6 promises
*
* @param {File} file - File to parse
* @param {string} [type=array] - Type to parse
* @returns {Promise<Object, String>}
*
* @see https://www.npmjs.com/package/xlsx
*/
function spreadParser(file, type = 'array') {
var mysql = require('mysql2');
var Client = require('ssh2').Client;
var ssh = new Client();
var db = new Promise(function(resolve, reject){
ssh.on('ready', function() {
ssh.forwardOut(
// source address, this can usually be any valid address
'127.0.0.1',
// source port, this can be any valid port number
@hmanzur
hmanzur / Nest.js Dockerfile
Created July 16, 2020 23:41
Nest.js Dockerfile
# Dockerfile
ARG NODE_VERSION='12.18-alpine'
# --------------- Build
FROM node:${NODE_VERSION} As development
WORKDIR /usr/src/app
COPY package*.json ./
@hmanzur
hmanzur / NumberMaskedInput.jsx
Last active February 23, 2021 14:44
React component version
import React from 'react'
import PropTypes from 'prop-types'
/**
* NumberMaskedInput component
* Created by habib on 5/06/2020
*
* @public
* @class
@hmanzur
hmanzur / git.bat
Created December 4, 2019 02:43
WSL bash git on Windows
:: @Path C:\Windows\System32\git.bat
::
:: @Use in CMD or Powershell "git <command>"
::
@echo off
C:\Windows\System32\bash.exe -c "git %*"