Skip to content

Instantly share code, notes, and snippets.

View thehackermonkey's full-sized avatar
🚀
startup

Hans thehackermonkey

🚀
startup
View GitHub Profile
@thehackermonkey
thehackermonkey / renderComponent_example.svelte
Created December 11, 2023 20:45
Display custom Svelte components using TanStack Table
<script>
// your custom component using a Badge for demo
import Badge from '@/components/Badge.svelte'
// renderComponent is the magic
import {
createSvelteTable,
createColumnHelper,
renderComponent,
@thehackermonkey
thehackermonkey / claves_regimes_fiscales_mexico.json
Created December 13, 2022 19:24
Un json con las claves de regimenes fiscales en México (2022) [para esas migraciones de facturación 4.0]
[
{
"Clave": 601,
"Descripción": "General de Ley Personas Morales"
},
{
"Clave": 603,
"Descripción": "Personas Morales con Fines no Lucrativos"
},
{
@thehackermonkey
thehackermonkey / load_dotenv.sh
Created May 29, 2022 00:22
Command line way to extract and export variables from a .env file ignoring commented lines using #
export $(grep -v '^#' .env | xargs)
@thehackermonkey
thehackermonkey / Makefile
Created September 30, 2020 16:21
Build and upload docker image to ECR (aws cli 2.0.+)
organization = {YOUR_ORGANIZATION_PROFILE_NAME use 'default' if no multiple organizations}
ecr_id = {YOUR_AWS_ACCOUNT_ID}
project_name = {YOUR_ECR_PROJECT_NAME}
aws_region = {AWS_REGION}
git_sha = $(shell git rev-parse --short=8 HEAD)
docker-login:
$(aws --region $(aws_region) ecr get-login-password \
| docker login \
--password-stdin \
@thehackermonkey
thehackermonkey / upload_pre_signed_single_image.jsx
Created June 9, 2020 18:58
Ejemplo de subida de una imagen a través de una url pre firmada por el backend usando reactjs
import React, {useState, useEffect} from 'react';
import axios from 'axios';
export default function imagesUpload() {
const [file, setFile] = useState();
const [awsUrl, setAwsUrl] = useState(null);
useEffect(() => {
axios.get('http://localhost:3001/presignedUrl')
.then(r => setAwsUrl(r.data))
'use strict';
const Hapi = require('@hapi/hapi');
const AWS = require("aws-sdk");
const { v4: uuidv4 } = require('uuid');
const queryString = require('query-string');
AWS.config.update({region: 'us-west-2'});
const s3 = new AWS.S3({
server {
#listen 80;
listen 80 default_server;
listen [::]:80 default_server;
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl;
# listen 443 default_server;
# managed by Certbot
[
{
"id": 4592,
"lat": 25.686718,
"long": -100.322927,
"group": "Monterrey",
"name": "Bernardo Reyes",
"type": "Urbana con Tienda",
"address": "Av. Colón #100 Ote., esq. Bernardo Reyes, Col. Central. Monterrey, N.L.",
"municipio_id": 29,
@thehackermonkey
thehackermonkey / spec.md
Created June 4, 2016 21:51 — forked from Siedrix/spec.md
The imposible project

Objetivo del evento:

  • Aprender a hacer landing pages.

Metricas a juzgar:

  • Que tan poco viable es la idea. Mientras menos viable y mas sci-fi, mejor.
  • Hacer una landing page que venda esta idea y convenza de comprar esta idea.

Posibles ideas: