Skip to content

Instantly share code, notes, and snippets.

View Isradeveloper's full-sized avatar

Israel Trujillo Domínguez Isradeveloper

View GitHub Profile
@Klerith
Klerith / IndecisionView.html
Created April 3, 2024 19:19
Ventana de chat para el curso de Vue.js
<!-- Fuente: https://tailwindcomponents.com/component/chat-layout -->
<template>
<div class="bg-gray-100 h-screen flex flex-col max-w-lg mx-auto">
<div class="bg-blue-500 p-4 text-white flex justify-between items-center">
<span>Mi esposa</span>
</div>
<div class="flex-1 overflow-y-auto p-4">
<div class="flex flex-col space-y-2">
<!-- Messages go here -->
@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 / regular-exp.ts
Created September 9, 2023 16:55
Email Validation
export const regularExps = {
// email
email: /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/,
}
@Klerith
Klerith / self-certificates.sh
Last active November 13, 2025 17:57
Generar certificados
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt
@Klerith
Klerith / time-since.ts
Created November 2, 2022 20:36
Fecha de creación humana
export const timeSince = ( date: string ) => {
const baseDate = new Date(date)
const seconds = Math.floor(( new Date().getTime() - baseDate.getTime() ) / 1000);
let interval = seconds / 31536000;
@Klerith
Klerith / index.ts
Last active November 4, 2025 17:43
Vuex + TypeScript - Store Structure Strongly Typed
import { createStore } from 'vuex';
// My custom modules
import exampleModule from './module-template';
import { ExampleStateInterface } from './module-template/state';
export interface StateInterface {
// Define your own store structure, using submodules if needed
// example: ExampleStateInterface;
@mandeepm91
mandeepm91 / list-all-objects-from-an-s3-bucket.js
Created April 15, 2018 12:13
Lists all objects from an S3 bucket
/*
AWS SDK for Node.js provides the s3.listObjects API which
lists the objects from a bucket. However, if you have a lot
of objects in your bucket then the response of this API is
truncated. So, the entire contents of a bucket cannot be
fetched in a single API call and you need to call the API
multiple times, each time passing a `marker` parameter which
is the `Key` of the last element of the previous response.
This gist is demonstrating the same. This script uses async/await
feature of the Node.js so make sure you have the appropirate