Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ukeje Chukwuemeriwo Goodness Goodnessuc

🎯
Focusing
View GitHub Profile
@Goodnessuc
Goodnessuc / transact.go
Last active Nov 13, 2022
Database transactions in Go
View transact.go
package main
import (
"context"
"database/sql"
_ "github.com/mattn/go-sqlite3"
"log"
)
func main() {
@Goodnessuc
Goodnessuc / controller.go
Created Nov 8, 2022
Updates to LogRocket's Gin Gonic tutorial article
View controller.go
package controllers
import (
"Go-Tutorials/models"
"github.com/gin-gonic/gin"
"net/http"
)
type CreateBookInput struct {
Title string `json:"title" binding:"required"`
View chrouter.go
package main
import (
"encoding/json"
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"log"
"net/http"
)
View suffering.go
package main
import (
"fmt"
"gorm.io/driver/postgres"
"gorm.io/gorm"
"log"
"os"
)
@Goodnessuc
Goodnessuc / gin.go
Last active Sep 7, 2022
CRUD API in Go using the Gin FrameWork - Article for Earthly Technologies
View gin.go
package main
import (
"github.com/gin-gonic/gin"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"log"
"net/http"
)
@Goodnessuc
Goodnessuc / jwt.go
Created Jul 24, 2022
JWT tutorial in Go using the golang-jwt package
View jwt.go
package main
import (
"encoding/json"
"fmt"
"github.com/golang-jwt/jwt"
"log"
"net/http"
"time"
)
View fltk.rs
// [dependencies]
// fltk = { version = "^1.3", features = ["fltk-bundled"] }
use fltk::{app, prelude::*, window::Window};
fn my_app() {
let app = app::App::default();
let mut app_window = Window::new(100, 100, 400, 300, "Checking out the FLTK-rs Library");
app_window.end();
@Goodnessuc
Goodnessuc / generator.go
Created Jun 27, 2022
Generate Cryptographically secure random values of any type in Go
View generator.go
func generateCryptoRandom(chars string, length int32) string {
bytes := make([]byte, length) _, err := rand.Read(bytes)
if err != nil {
fmt.Println(err)
}
@Goodnessuc
Goodnessuc / nethttp.go
Created Jun 26, 2022
A CRUD API using the net/http package
View nethttp.go
package main
import (
"encoding/json"
"log"
"net/http"
)
type Person struct {
Name string `json:"name"`
@Goodnessuc
Goodnessuc / linkedlist.go
Created Jun 25, 2022
Implementation of a linkedlist in Go
View linkedlist.go
package main
import "fmt"
type Node struct {
data any
next *Node
}
type LinkedList struct {