Skip to content

Instantly share code, notes, and snippets.

View Jarrioja's full-sized avatar

Jesus Arrioja Jarrioja

View GitHub Profile
@Jarrioja
Jarrioja / configurar-node-ts.md
Last active November 20, 2024 14:17 — forked from Klerith/configurar-node-ts.md
Node con TypeScript - TS-Node-dev simplificado

Node con TypeScript - TS-Node-dev (preferido)

  1. Instalar TypeScript y demás dependencias
pnpm add -D typescript @types/node ts-node-dev rimraf
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
npx tsc --init --outDir dist/ --rootDir src
@Jarrioja
Jarrioja / git-alias.md
Created October 24, 2021 14:11 — forked from Klerith/git-alias.md
Useful Git Alias

Log

git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"

Status

git config --global alias.s status --short

Alternativa útil de status

git config --global alias.s status -sb

@Jarrioja
Jarrioja / woocommerce-subscription.php
Created July 2, 2019 18:53
Si el usuario tiene una suscripción activa el botón de cambiar suscripción, el cual envía al carrito la orden de cambio de suscripción en lugar de agregar una nueva suscripción.
add_filter('woocommerce_before_single_product_summary', 'prefix_subscriptions_checkout_button', 10, 2);
//woocommerce_add_to_cart_validation
function prefix_subscriptions_checkout_button( $args = array() ) {
$button_arr = wp_parse_args( $args, array(
'variation_id' => 0,
'btn_class' => array( 'button', 'button-primary' ),
'btn_text' => __( 'Test' ),
'btn_atts' => array(),
apt-get install elasticsearch
#!bin/bash
# quietly add a user without password
adduser --quiet --disabled-password --shell /bin/bash --home /home/adminhub --gecos "User" adminhub
# set password
echo "adminhub:adminhub" | chpasswd
wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh
bash Anaconda3-5.2.0-Linux-x86_64.sh -b
#!bin/bash
# quietly add a user without password
adduser --quiet --disabled-password --shell /bin/bash --home /home/adminhub --gecos "User" adminhub
# set password
echo "adminhub:adminhub" | chpasswd
wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh
bash Anaconda3-5.2.0-Linux-x86_64.sh -b
@Jarrioja
Jarrioja / jupyterhub_config.py
Created August 9, 2018 15:48
FOR Jupyterhub-LAB
#------------------------------------------------------------------------------
# Configuration file for jupyterhub.
#------------------------------------------------------------------------------
# set of users who can administer the Hub itself
c.Authenticator.admin_users = {'adminhub'}
## The public facing port of the proxy.
c.JupyterHub.port = 80
wget https://gist.github.com/Jarrioja/3e326ea9814d9db96148d46aa4e428e2/raw/93ca93873ba975d43ede77123c9ee2e6275adde4/jupyterhub-script.sh
bash jupyterhub-script.sh
wget https://gist.github.com/Jarrioja/412cfd01f1f2d584c9b9476bf5e9277d/raw/2baeb0e280e49922da5daac041f6c8b1917ae214/jupyterHUB-service.sh
bash jupyterHUB-service.sh
#!bin/bash
# quietly add a user without password
adduser --quiet --disabled-password --shell /bin/bash --home /home/adminhub --gecos "User" adminhub
# set password
echo "adminhub:adminhub" | chpasswd
wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh
bash Anaconda3-5.2.0-Linux-x86_64.sh -b