Skip to content

Instantly share code, notes, and snippets.

@hectorgool
hectorgool / main.go
Created November 23, 2021 20:15 — forked from err0r500/main.go
gin gonic with jwt from auth0 (and CORS enabled)
package main
import (
"github.com/auth0/go-jwt-middleware"
"github.com/dgrijalva/jwt-go"
"gopkg.in/gin-gonic/gin.v1"
)
func main() {
startServer()
@hectorgool
hectorgool / order_confirmation_shopify.html
Created August 16, 2019 01:55
Order confirmation Shopify
{% capture email_title %}Thank you for your purchase! {% endcapture %}
{% capture email_body %}
{% if requires_shipping %}
Hi {{ customer.first_name }}, we're getting your order ready to be shipped. We will notify you when it has been sent.
{% endif %}
{% endcapture %}
<!DOCTYPE html>
<html lang="en">
<head>
import 'dart:convert';
void main() {
final rawJson = '{"nombre": "Logan", "poder": "Regeneración"}';
Map parsedJson = json.decode(rawJson);
//print(parsedJson);
final wolverine = new Heroe.fromJson(parsedJson);
@hectorgool
hectorgool / ssl_kafka_generate_files.sh
Created July 5, 2019 16:45
Para generar los certificados para Kafka
openssl req -new -newkey rsa:4096 -days 365 -x509 -subj "/CN=Kafka-Security-CA" -keyout ca-key -out ca-cert -nodes
# ca-cert publico
# ca-key privado
#ssl port 9093
export SRVPASS=serversecret
#para crear un kafka broker certificate
#CN callname => el dns publico
# Dockerfile References: https://docs.docker.com/engine/reference/builder/
# Start from golang v1.11 base image
FROM golang:1.11
#RUN apk add git
# Add Maintainer Info
LABEL maintainer="Santo <hectorgool@gmail.com>"
@hectorgool
hectorgool / main.go
Created October 5, 2018 09:53
Lambda functions in a local development environment
//_LAMBDA_SERVER_PORT=3000 go run main.go
package main
import (
"encoding/json"
"github.com/aws/aws-lambda-go/lambda"
)
type Data struct {
@hectorgool
hectorgool / main.go
Last active September 1, 2018 01:17
mango example
/*
go get -v labix.org/v2/mgo
*/
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"log"
@hectorgool
hectorgool / hola.txt
Last active August 13, 2018 18:15
Se tiene un archivo txt y se quiere leer su contenido para procesarlo.
hola
@hectorgool
hectorgool / webpack.config.js
Last active June 30, 2018 00:38
webpack template production and develop
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = (env) => {
const plugins = [
new ExtractTextPlugin("css/[name].[hash].css")
]
@hectorgool
hectorgool / index.html
Last active May 24, 2018 16:51
production
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Platzi Video</title>
</head>
<body>
<div id="app"></div>
<script src="http://localhost:9000/js/santo.js"></script>
</body>