Giter Site home page Giter Site logo

beakeyz / dadjoke-gen Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 292 KB

A client-server dynamic, written in golang, to store and obtain dadjokes to and from a sql database

Go 99.80% Makefile 0.20%
client client-server dadjokes experimental funny server

dadjoke-gen's Introduction

this sums it up pretty well I guess

package beakeyz

import(
    "fmt"
)

type Beakeyz struct {
    Id            int
    FavoriteLangs []string
    Learning      []string
    Hates         []string
    Loves         []string
}

// helper function in a readme. Noice
func getAttribute(a []string) string {
    var val string
    for index, value := range(a) {
        if index == len(a) - 1 {
            val = append(val, "and " + value)
        } else {
            val = append(val, value + ", ")
        }
    }
    return val
}

// mega epic
func (self Beakeyz) PrintSelf() {
    fmt.Printf("My age is: %s\n", self.Id)
    
    fmt.Printf("My favorite languages are: %s\n", getAttribute(self.FavoriteLangs))
    fmt.Printf("I'm currently learning: %s\n", getAttribute(self.Learning))
    fmt.Printf("I don't like: %s\n", getAttribute(self.Hates))
    fmt.Printf("I love: %s\n", getAttribute(self.Loves))
}

// main function (this comment is for people without eyeballs)
func main() {
    var me Beakeyz = &Beakeyz {
        Id: 18,
        FavoriteLangs: []string{"go", "java", "c"}, // java is just here because of nostalgia, its pretty trash otherwise lol
        Learning: []string{"C#", "Rust", "(opperating) systems", "assembly"},
        Hates: []string{"not much atm"},
        Loves: []string{"skiing", "programming", "music", "crap to do with space"}
    }

    me.PrintSelf()
}

dadjoke-gen's People

Contributors

beakeyz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

dadjoke-gen's Issues

Todo recode

Build sequence, router, http-server, among other things...

Broken commit

Latest commit is broken. I tried to implement grafanas solution to an import cycle which is very hard to resolve.

Security vaulnerability prob

because both the server and the client save the same Session Id, there might be some holes in this kind of security system.
Instead look into hashing the Session Id server-side together with the user defined password hash (we ain't gonna store that raw password like a normie). This requires us to make some modifications to the SessionManager, which we prob already had to do cuz this design choice is fucking balls =]

TODO

TODO: Implement a token system so users can post jokes to the database IF they have a valid token.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.