GithubHelp home page GithubHelp logo

mawais54013 / burger Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4.82 MB

This program allows the user especially gamers to store which videos they like over others. The user can add games and select whether they are good or bad. Then later if they choose, the user can change the video games if they find it better than expected.

Home Page: https://burghammad.herokuapp.com/https://burghammad.herokuapp.com/

JavaScript 69.73% HTML 28.97% CSS 1.31%

burger's Introduction

Game Organizer

This program allows the user especially gamers to store which video games they like over others. The user can add games and select whether they are good or bad. Then later if they choose, the user can change the video games if they find it better than expected. Other than that enjoy gaming!!!!

Game Organizer

Portfolio

Images

website

This is a pic of the website deployed from Heroku and also includes various games I included but more can be added with just a keyboard away.

Technology Used

  • Handlebars.js
  • Express.js
  • Javascript
  • JQuery
  • MYSQL
  • Node.js
  • ORM middleware
  • Heroku

Code Snippets

  1. The following code snippet is a middleware I used called ORM, this allows the program to take functions and receive data from the database to response back. In this case, this code is selecting all information from the database and using a callback function to return it.
var orm = {
    selectAll: function(tableInput, cb)
    {
    var queryString = "SELECT * FROM " + tableInput + ";";
    connection.query(queryString, function(err, result)
    {
        if(err)
        {
            throw err;
        }
        cb(result);
    });
    },
}
  1. The next code is used to make a ajax call to perform a function. In this case, I take the information the user inputted as a variable object with two keys to transfer to /api/burgers to POST them to the database and later in the code to give them attributes and show them on the DOM.
$(".create-form").on("submit", function(event) {
event.preventDefault();
var newGame = {
    name: $("#gameName").val().trim(),

    // two values provided 
    bad: $("[name=bad]:checked").val().trim()
};
$.ajax("/api/burgers", {
    type: "POST",
    data: newGame
}).then(function()
{
    console.log("adding a new game");
    location.reload();
})

});

Author

Muhammad Awais

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.