Skip to content

Instantly share code, notes, and snippets.

View ricardoltm's full-sized avatar
😃
Só alegria!!!

Ricardo Manso ricardoltm

😃
Só alegria!!!
View GitHub Profile
@ricardoltm
ricardoltm / logging.go
Created June 5, 2021 13:32 — forked from panta/logging.go
zerolog with file log rotation (lumberjack) and console output
package logging
import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"gopkg.in/natefinch/lumberjack.v2"
"os"
"path"
"io"
)
@ricardoltm
ricardoltm / nullHandle.go
Created March 6, 2021 03:02 — forked from rsudip90/nullHandle.go
How I handled the null possible value in a sql database row in golang?
package main
import (
"database/sql"
"encoding/json"
"fmt"
"reflect"
"time"
"github.com/go-sql-driver/mysql"
@ricardoltm
ricardoltm / imap-search
Created September 16, 2020 02:59 — forked from martinrusev/imap-search
IMAP Search criteria
@ricardoltm
ricardoltm / Knex-Migrations-Seeding.md
Created August 1, 2020 19:36 — forked from NigelEarle/Knex-Migrations-Seeding.md
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

@ricardoltm
ricardoltm / Knex-Setup.md
Last active August 1, 2020 19:36 — forked from NigelEarle/Knex-Setup.md
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init