Skip to content

Instantly share code, notes, and snippets.

View fransafu's full-sized avatar
🎯
Keep it simple

Francisco Javier Sánchez Fuentes fransafu

🎯
Keep it simple
View GitHub Profile
@fransafu
fransafu / 4_tercero.js
Created February 7, 2020 00:15
[Node.js] Uso de modulo de tercero (npm)
/*
Para completar exitosamente este punto se debe inicializar npm dentro del proyecto
con el comando 'npm init'. Este genera una serie de preguntas como el nombre del proyecto,
la version, entre otras preguntas.
+ npm init
+ npm install --save is-number
Esperar a que se cree el archivo package.json, luego instalar la dependencia, esperar
a que este creado el archivo package-lock.json y la carpeta node_modules.
@fransafu
fransafu / 1_serverHTTP.js
Created February 7, 2020 00:22
[Node.js] Servidor HTTP simple en el puerto 8080
// Llamar Biblioteca nativa para levantar un servidor HTTP
const http = require('http');
// Crear servidor
const server = http.createServer((req, res) => {
res.write('Hello World');
res.end();
});
// Especificar en que puerto debe escuchar el servidor las peticiones
@fransafu
fransafu / 2_serverHTTPWithRoutes.js
Created February 7, 2020 00:25
[Node.js] Servidor HTTP simple con rutas
// Llamar Biblioteca nativa para servidor HTTP
const http = require('http');
// Crear el servidor HTTP
const server = http.createServer((req, res) => {
// Observa como vienen las rutas
// console.log(req.url);
if (req.url === '/') {
res.write('Ahora te encuentras en el Home "/"');
return res.end();
@fransafu
fransafu / simple-rest-golang.yaml
Created May 4, 2020 03:32
k3s example for simple-rest-golang
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: simple-rest-golang-deployment
namespace: retail-project-dev
spec:
replicas: 2
selector:
matchLabels:
@fransafu
fransafu / install_oh_my_zsh_amazon_linux.md
Created April 23, 2022 06:33
Install Oh-My-Zsh on Amazon EC2 instance running Amazon Linux

Install Oh-My-Zsh on Amazon EC2 instance running Amazon Linux

  1. Check for updates

    • sudo yum update -y
  2. Install dependencies

    • sudo yum install -y zsh util-linux-user
  3. Change to zsh to default

  • sudo chsh -s /usr/bin/zsh $USER