Skip to content

Instantly share code, notes, and snippets.

View Xansiety's full-sized avatar
🦇
Probably programming or watching anime 🐣

Fernando Xansiety

🦇
Probably programming or watching anime 🐣
View GitHub Profile
@m-jovanovic
m-jovanovic / publish.yml
Created January 10, 2025 17:14
Sample GitHub Actions workflow to build a .NET application, build a Docker image, upload to Azure Container Registry, and then publish the image into Azure Container App
name: Deploy to Azure Container Apps
on:
workflow_dispatch:
push:
branches: [main]
env:
AZURE_CONTAINER_REGISTRY: <NAME>
CONTAINER_APP_NAME: <NAME>
@Klerith
Klerith / random-hex.md
Created September 22, 2023 17:47
Secure Random Hex

Comando con Ruby instalado

ruby -rsecurerandom -e 'puts SecureRandom.hex(20)'

Ejemplo: No usar en producción

4510c8cf2fe423f8be5afccbdd30c678677e172b

@Klerith
Klerith / tarea-pg-admin.md
Last active March 16, 2026 22:08
Tarea sobre PGAdmin y Postgres

Docker Hub images

Postgres

pgAdmin

1. Crear un volumen para almacenar la información de la base de datos

docker COMANDO CREAR postgres-db

2. Montar la imagen de postgres así

OJO: No hay puerto publicado -p, lo que hará imposible acceder a la base de datos con TablePlus

@Klerith
Klerith / time-since.ts
Created November 9, 2022 19:56
Time Since
export const timeSince = ( date: string ) => {
const baseDate = new Date(date)
const seconds = Math.floor(( new Date().getTime() - baseDate.getTime() ) / 1000);
let interval = seconds / 31536000;
if (interval > 1) {
@Klerith
Klerith / IconPinia.vue
Created October 20, 2022 15:29
Pinia Animated Logo
<template>
<svg
class="pinia-container"
width="150"
height="150"
viewBox="0 0 408 520"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g class="leaves">
@Klerith
Klerith / is-valid-email.ts
Created October 8, 2021 22:56
Email validation - customHook
const isValidEmail = ( email: string ) => {
const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
@codigoconjuan
codigoconjuan / imagenes.js
Created August 4, 2021 21:43
Gist Soporte Imagenes WebP y Avif como Background
(function (document) {
var checkCount = 0,
formatFound = false;
function setHTMLClass(height, className) {
checkCount++;
if (height == 2) {
formatFound = true;
document.documentElement.className += " " + className;
} else {
@codigoconjuan
codigoconjuan / gist:30973f8e5e7d210e0458bc49a55ad2c4
Last active June 12, 2025 21:33
Gist para Imágenes HTML5 con AVIF, webp y JPG
"imagenes": {
"prefix": "pic",
"body": [
"<picture>",
"<source",
"\t sizes=\"1920w, 1280w, 640w\" ",
"\t srcset=\"img/imagen.avif 1920w, \n\t\t\t img/imagen-1280.avif 1280w, \n\t\t\t img/imagen-640.avif 640w\" ",
"\t type=\"image/avif\">",
"<source",
"\t sizes=\"1920w, 1280w, 640w\" ",
@Klerith
Klerith / modal.css
Created July 30, 2021 13:42
Estilos para un modal manual
.modal-background {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
display: flex;
background-color: rgba(0, 0, 0, 0.5);
align-items: center;
@Klerith
Klerith / git-config.md
Created November 10, 2020 21:17
Configuración de email y usuario de Git
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com