Skip to content

Instantly share code, notes, and snippets.

View Santiago-j-s's full-sized avatar

Santiago Santana Santiago-j-s

View GitHub Profile
@Santiago-j-s
Santiago-j-s / machine.js
Created September 13, 2021 02:37
Generated by XState Viz: https://xstate.js.org/viz
const DIAS_CRITICIDAD_MEDIA = 20;
const DIAS_CRITICIDAD_ALTA = 10;
const DIAS_VENCIDO = 0;
const isProximoAVencer = (context) =>
context?.days <= DIAS_CRITICIDAD_ALTA;
const isVencido = (context) => context?.days <= 0;
const isCriticidadMedia = (context) =>
context?.days <= DIAS_CRITICIDAD_MEDIA;

Caminos de aprendizaje

Cada día en twitter veo algún comentario del estilo "los devs deberían saber X, quienes no saben X no son buenos devs", siendo la segunda parte usualmente tácita.

X cada día es algo diferente:

  • Saber CSS en lugar de tailwind
  • Conocer JS en lugar de frameworks
  • Saber de grafos, algoritmos y estructuras de datos
  • Saber de deployment si haces back
<?php
set_time_limit(1000);
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'https://www.freetogame.com/api/games'
]);
@Santiago-j-s
Santiago-j-s / apB1.js
Last active December 29, 2020 05:50
you don't know js exercises
function validTime(time) {
return time.match(/\d?\d:\d?\d/) !== null;
}
function toMinutes(time) {
if (!validTime(time)) {
throw 'time must be of format hh:mm';
}
const parts = time.split(":");
  • Los procesadores CISC tienen instrucciones complejas
  • Estas instrucciones se dividen en una serie de pasos más pequeños
  • Estos pasos se ejecutan en serie en diferentes partes del procesador (forman algo similar a una línea de ensamble)
  • Ante un branch (un if) no se puede anticipar cual va a ser la siguiente instrucción que hay que meter en el pipeline
  • Detener todo el pipeline hasta saber que instrucción va a ejecutarse destruye cualquier mejora en la performance que el pipeline pueda ofrecer
  • Intentar predecir que camino va a tomar el branch es una mejor opción
  • Al errarle al camino hay que reconstruir pipeline, es mucho más lento

Los procesadores RISC igual tienen pipeline, las instrucciones sin embargo son mucho más simples y el pipeline suele ser muy pequeño.

# https://github.com/hardcoreplayers/dotfiles/blob/master/tmux/.tmux.conf
# battery colors
set -g @batt_color_charge_secondary_tier8 'colour0'
set -g @batt_color_charge_secondary_tier7 'colour0'
set -g @batt_color_charge_secondary_tier6 'colour0'
set -g @batt_color_charge_secondary_tier5 'colour0'
set -g @batt_color_charge_secondary_tier4 'colour15'
set -g @batt_color_charge_secondary_tier3 'colour15'
set -g @batt_color_charge_secondary_tier2 'colour15'
call plug#begin('~/.vim/plugged')
" git
Plug 'tpope/vim-fugitive'
Plug 'mhinz/vim-signify'
" status line
Plug 'itchyny/lightline.vim'
" start screen
# PRODUCTION DOCKERFILE
# ---------------------
# Sourced from: https://github.com/Saluki/nestjs-template/blob/master/Dockerfile
#
# This Dockerfile allows to build a Docker image of the Express application
# and based on a NodeJS 12 image. The multi-stage mechanism allows to build
# the application in a "builder" stage and then create a lightweight production
# image containing the required dependencies and the JS build files.
#
# Dockerfile best practices
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.