This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"context" | |
"encoding/csv" | |
"fmt" | |
"io" | |
"log" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
// Node is the basic structure to store the key and value. Also store the prev and next node. | |
type Node struct { | |
key string | |
value string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This data is a mock from your real data | |
const data = [{"name": "apple"}, {"name": "onion"}, {"name": "banana"}] | |
// We want to write this data into a string | |
const dataToString = data => { | |
let resp = "" | |
data.forEach(e => resp += e.name + "\n") | |
return resp | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get the provider name | |
name="" | |
read -p "Write the provider name: " name | |
# Ask to dev if want to remove comments with <<>> | |
removeComments="N" | |
read -p "Do you want to remove the helpers comments? [y/N]: " removeComments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (h *Handler) Subscribe(c echo.Context) error { | |
var epoch = time.Unix(0, 0).Format(time.RFC1123) | |
c.Response().Header().Set(echo.HeaderContentType, "text/event-stream") | |
c.Response().Header().Set("Cache-Control", "no-cache") | |
c.Response().Header().Set("Connection", "keep-alive") | |
c.Response().Header().Set("Expires", epoch) | |
c.Response().Header().Set("Cache-Control", "no-cache, private, max-age=0") | |
c.Response().Header().Set("Pragma", "no-cache") | |
c.Response().Header().Set("X-Accel-Expires", "0") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"log" | |
"net/http" | |
"regexp" | |
"strconv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Genera los días festivos de colombia dado un año | |
// Basado en los artículos: | |
// https://www.festivos.com.co/calculo y https://elpais.com/elpais/2017/04/12/el_aleph/1492008750_544261.html | |
package main | |
import ( | |
"fmt" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Field structura de un tipo de campo del modelo | |
type Field struct { | |
Name string | |
Type string | |
NotNull string | |
} | |
// Helper estructura que permite procesar los campos digitados | |
type Helper struct { | |
Fields []Field |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Original Data: | |
id idparent jobNO | |
-------------------------------- | |
1 0 1 | |
2 1 2 | |
3 1 3 | |
4 0 4 | |
5 4 5 | |
6 5 6 |
NewerOlder