Skip to content

Instantly share code, notes, and snippets.

View tecnologer's full-sized avatar
👨‍💻
Focusing

Rey David Dominguez Soto tecnologer

👨‍💻
Focusing
View GitHub Profile

Code Stats

This script checks your code stats of the current dir. If previous stats are stored, they could be compared to them.

Preconditions

Requires [tokei][1], you could install it using:

  • Debian/Ubuntu: apt install tokei
  • Mac: brew install tokei
@tecnologer
tecnologer / main.go
Created June 15, 2024 07:24
Programacion funcional - transform (map)
package main
import (
"fmt"
"math"
"strconv"
"strings"
"golang.org/x/text/cases"
"golang.org/x/text/language"
@tecnologer
tecnologer / create_db.sh
Created February 19, 2024 19:07
create docker database psql|mysql
#!/bin/bash
# Function to display help
function display_help() {
echo "Usage: $0 <db-type> [OPTIONS]"
echo "db-type: Type of the database ('psql' for PostgreSQL, 'mysql' for MySQL)."
echo "Options:"
echo " --container-name Name of the Docker container to be used. Default is 'docker-postgres' for PostgreSQL and 'docker-mysql' for MySQL."
echo " --db-password Password for the database. Default is 'S3cret*_2024'."
echo " --db-user User for the database. Default is 'admin' for mysql and 'postgres' for psql."
@tecnologer
tecnologer / .golangci.yml
Last active April 18, 2024 17:36
Install and configure golangci-lint
linters-settings:
cyclop:
skip-tests: true
tagalign:
align: true
sort: true
order:
- json
- validate
- gorm
@tecnologer
tecnologer / chat.go
Last active January 31, 2024 17:36
Factory to build Functions objects for OpenAI API
package agent
import (
"context"
"encoding/json"
"fmt"
"github.com/pkg/errors"
"github.com/tmc/langchaingo/llms"
"github.com/tmc/langchaingo/llms/openai"
"github.com/tmc/langchaingo/schema"
@tecnologer
tecnologer / main.go
Created January 25, 2024 16:26
Parses Go's functions to JSON Schema to use with OpenAI API functions
package main
import (
"flag"
"fmt"
"go/ast"
"go/parser"
"go/token"
"os"
"regexp"
@tecnologer
tecnologer / Code.cs
Created November 17, 2022 16:05
CodeQR
public class CodeQR
{
public Code Code {get;}
public CodeQR() {
Code = new Code();
}
public int GetCode()
{
@tecnologer
tecnologer / agnoster.zsh-theme
Created September 26, 2022 15:35
zsh theme custom
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@tecnologer
tecnologer / release_name_generator.sh
Created September 24, 2021 19:44 — forked from levhita/release_name_generator.sh
Name generator that matchs an uncommon adjective with a common animal.
#!/bin/bash
adjectives=('Adamant' 'Adroit' 'Amatory' 'Animistic' 'Antic' 'Arcadian' 'Baleful'
'Bellicose' 'Bilious' 'Boorish' 'Calamitous' 'Caustic' 'Cerulean' 'Comely'
'Concomitant' 'Contumacious' 'Corpulent' 'Crapulous' 'Defamatory' 'Didactic'
'Dilatory' 'Dowdy' 'Efficacious' 'Effulgent' 'Egregious' 'Endemic' 'Equanimous'
'Execrable' 'Fastidious' 'Feckless' 'Fecund' 'Friable' 'Functional' 'Fulsome'
'Garrulous' 'Guileless' 'Gustatory' 'Heuristic' 'Histrionic' 'Hubristic'
'Incendiary' 'Insidious' 'Insolent' 'Intransigent' 'Inveterate' 'Invidious'
'Irksome' 'Jejune' 'Jocular' 'Judicious' 'Lachrymose' 'Limpid' 'Loquacious'
'Luminous' 'Mannered' 'Mendacious' 'Meretricious' 'Minatory' 'Mordant'
@tecnologer
tecnologer / go-installer.sh
Last active December 14, 2024 17:01
Bash script to install/update Go on Linux, Dependencies: curl and tar
#!/bin/bash
# Exit on any error
set -e
# Determine which shell the user is using and select the appropriate profile file
if [[ "$SHELL" == */zsh ]]; then
PROFILE_FILE="$HOME/.zshrc"
elif [[ "$SHELL" == */bash ]]; then
PROFILE_FILE="$HOME/.bashrc"