Skip to content

Instantly share code, notes, and snippets.

@fulldump
fulldump / placeholders.go
Last active May 29, 2024 12:05
Golang Placeholders
package placeholders
import (
"regexp"
"strings"
)
var placeholders = regexp.MustCompile(`{{([^}]*)}}`)
func Traverse(input string, callback func(string) string) (output string) {
@fulldump
fulldump / createNote.js
Created February 10, 2024 04:00
Application 'MyNotes' from scratch on hola.cloud
// POST /notes
let a = auth();
let user_id = a.user.id;
// inception credentials
let credentials = {
"database_id": "0629698a-2de5-491a-852a-8041e3fa5dd4",
"api_key": "dd38017d-8d8d-40a7-88bf-3141e03355b5",
"api_secret": "616ca676-b3e5-4a8a-a725-b03417f5362b"

write(string)

Description: This function is used to write a response body to the HTTP request. It takes a string as its argument and sends it as the response content to the client. Example in JavaScript:

write("Hello, World!");

writeStatus(int)

@fulldump
fulldump / openapi.go
Created October 18, 2023 16:17
Openapi example
package openapi
import (
"context"
"net/http"
"reflect"
"strings"
"github.com/fulldump/box"
)
package main
import (
"crypto/tls"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
@fulldump
fulldump / manipulator.go
Created April 21, 2023 09:53 — forked from gerardojimenezform3/manipulator.go
Manipulator - a wrapper to set and get attributes from any struct to prevent nil pointers and other issues
package manipulator
import (
"fmt"
"reflect"
"strings"
)
type Manipulator struct {
any
@fulldump
fulldump / pipelang.go
Last active April 21, 2023 09:54
pipelang - Extreme simple language (it was coded by GPT3.5)
package main
import (
"fmt"
"strings"
)
type Function struct {
Name string
Args []string
@fulldump
fulldump / main.go
Created November 2, 2022 00:06
HoneyGo
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
@fulldump
fulldump / bigfile.go
Created April 27, 2020 00:05
Comando wc reescrito en golang
package main
import "os"
func main() {
line := []byte("1,22,333,4444,55555,666666,7777777,88888888\n")
n := 50 * 1000 * 1000
for i := 0; i < n; i++ {
os.Stdout.Write(line)