Skip to content

Instantly share code, notes, and snippets.

@josepereza
josepereza / docker.md
Created February 14, 2026 17:11
Docker y docker compose cheat sheets

Docker Cheat Sheet — Containerization Platform

Complete Docker reference — images, containers, volumes, networks, Compose, Dockerfile, and multi-stage builds.

Images

docker images                        # List images
docker pull nginx:latest             # Pull image
docker build -t myapp:1.0 .         # Build from Dockerfile
@josepereza
josepereza / sql window functions.md
Created February 6, 2026 10:30
SQL WINDOW FUNCTIONS

SQL Window Functions Examples

This gist provides practical examples of SQL window functions to enhance your data analysis skills. Through these examples, you'll learn how to use various window functions to perform complex calculations like ranking, running totals, moving averages, and more.

1. Assign Row Numbers

SELECT id, salesperson, amount,
       ROW_NUMBER() OVER(ORDER BY amount DESC) AS row_num
FROM sales;
@josepereza
josepereza / postgres-query.md
Last active February 3, 2026 11:34
postgresql
@josepereza
josepereza / angular-infinite-scroll-cdk.md
Created October 2, 2020 13:42
Infinite Virtual Scroll with the Angular CDK

title: Infinite Virtual Scroll with the Angular CDK lastmod: 2018-10-21T18:16:07-07:00 publishdate: 2018-10-21T18:16:07-07:00 author: Jeff Delaney draft: false description: Build an Infinite Virtual Scroll with the Angular CDK tags: - angular

  • animation
const fetch = require('node-fetch')
/**********************************************************************************
OPCION TRADICIONAL
**********************************************************************************/
function getNombre(username){
const url = `https://api.github.com/users/${username}`
fetch(url)
.then( res => res.json() )
.then( json => { console.log(json.name) })
@josepereza
josepereza / GIT -guia rapida
Created March 18, 2020 07:38
GIT guia rapida
==========================================================================================
========== GIT – Guía rápida ==========
==========================================================================================
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------

How to use Materialize CSS in Angular 7-8-9

  • Install the materialize-css node package in your application.
npm install materialize-css --save
  • Open angular.json file & add below styles & scripts.
  "styles": [
         "./node_modules/materialize-css/dist/css/materialize.css",
@josepereza
josepereza / routing-lxc-container-ports.md
Last active December 8, 2019 08:57
Routing lxc container ports

Routing ports for lxc containers

Reference: Forward port to LXC guest using UFW, answer by Steve Zahn. March 17, 2014.

The lxd service can be used to manage lxc system containers on Linux hosts, very much like Docker does for application containers. One Docker feature that LXD lacks is a native parameter for routing container ports so they can be accessed on the network beyond the lxd host. Routing using the iptables command

On an lxd host protected by the standard iptables kernel firewall, the following command will route external traffic to a specific port of a specific container:

$ sudo iptables -t nat -A PREROUTING -i ens3 -p tcp --dport 8080 -j DNAT --to 10.1.0.5:80

@josepereza
josepereza / node js - materialize.md
Last active November 17, 2019 18:34
node js - materialize

*Primero se instala:

npm install materialize-css.
  • En el archivo index.html
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">