Skip to content

Instantly share code, notes, and snippets.

View jaalorsa517's full-sized avatar
🏠
Working from home

Jaime Ortiz jaalorsa517

🏠
Working from home
View GitHub Profile
@jaalorsa517
jaalorsa517 / Deploy_library_npm.sh
Created November 29, 2023 01:39
Deploy libreria
#!/bin/bash
# Ruta de la biblioteca a construir
libraryPath=""
# Ruta del proyecto objetivo
projectTarget=""
# Ruta de despliegue
deploy=""
@jaalorsa517
jaalorsa517 / rename.sh
Last active October 22, 2023 01:11
Rename list files, when deleted something characters
#!/bin/bash
dirpath=/home/jaalorsa/Descargas
pattern="y2mate.com - "
echo "[INFO] INICIANDO SCRIPT"
echo "[INFO] OBTENIENDO NOMBRES DESDE PATH $dirpath"
# Obtener la lista de archivos utilizando el comando ls
files=$(ls $dirpath)
@jaalorsa517
jaalorsa517 / Ejecutar consola desde JS
Created May 16, 2023 12:01
Este script es para poder ejecutar comandos consola desde JS
/**
* Script para ejecutar comando en consola a través de nodeJS
*
* Para windows, el path se respeta como nativo de windows. Ejemplo: C:\foldTest
*
* La función spawn, en windows funciona spawn("cmd.exe",myCommand).
* Por ejemplo, spawn("cmd.exe","dir")
*
*/
@jaalorsa517
jaalorsa517 / Function Random with Limits
Last active May 16, 2023 12:02
Algoritmo para obtener un número aleatoreo, entre un rango suministrado
const randomMinMax = (min = 0, max = 1) => Math.floor(Math.random() * (max - min + 1)) + min;
@jaalorsa517
jaalorsa517 / vueCreateCustomeElement.js
Last active March 2, 2024 16:35
Script base para incorporar dentro del proyecto Vue, para hacer un Custom Element
import { defineCustomElement, h, createApp, getCurrentInstance } from "vue";
export const vueDefineCustomElement = (component, { plugins = [] } = {}) =>
defineCustomElement({
...component,
setup(props, { emit }) {
const app = createApp(component);
// install plugins
plugins.forEach(app.use);
@jaalorsa517
jaalorsa517 / .dockerignore
Created December 9, 2021 00:09
Docker development nodejs
node_modules
npm-debug.log
Dockerfile
.dockerignore
.git
README.md
.gitignore
@jaalorsa517
jaalorsa517 / triangulo a tooltip
Last active May 16, 2023 12:03
Estilo CSS para hacer el triángulo en los tooltips
&::before {
content: '';
display: block;
position: absolute;
left: -40px;
top: 5px;
border-top: 20px solid transparent;
border-right: 20px solid $myBlog-silver;
border-left: 20px solid transparent;
border-bottom: 20px solid transparent;
@jaalorsa517
jaalorsa517 / funcional.py
Created December 12, 2020 22:45
Programacion funcional con python
def zero(f=None):
return 0 if not f else f(0)
def one(f=None):
return 1 if not f else f(1)
def two(f=None):
return 2 if not f else f(2)