Giter VIP home page Giter VIP logo

alpha.haml's People

Contributors

tyeung2017 avatar wyrd00 avatar

Watchers

 avatar  avatar  avatar

Forkers

wyrd00 tyeung2017

alpha.haml's Issues

Loop performance in handler.js

      file.toLowerCase().split(",").forEach((star) => {
        if ((star.indexOf(str) !== -1) && (result.length <= 10)) {
          result.push(star);
        }
      });

The above loop checks the whole file every time, even after a set of matches has been found. For loops have break so could be more appropriate here...

Fix search box

The search bar and header "jump" when the user type, maybe you can make it fixed, for better user experience

Destructuring requires for code clarity

This is more personal preference thing (I โค๏ธ destructuring).

This:

const { handleHome, handleAuto, handleIndex, handleCss, handleFavicon } = require('./handlers');

const router = (request, response) => {
  const url = request.url;
  if (url === '/') {
    handleHome(response);
  } else if (url.indexOf('/auto') !== -1) {
    handleAuto(request, response);
  } else if (url.indexOf('/index.js') !== -1) {
    handleIndex(request, response);
  } else if (url.indexOf('/main.css') !== -1) {
    handleCSS(request, response);
  } else if (url.indexOf('/favicon.ico') !== -1) {
    handleFavicon(request, response);
  } else {
    response.writeHead(404, "Content-Type:text/html");
    response.end("<h1>Heather fucked up</h1>");
  }
}

module.exports = router;

Is functionally the same as:

const handlers = require('./handlers');

const router = (request, response) => {
  const url = request.url;
  
  if (url === '/') {
    handlers.handleHome(response);
  } else if (url.indexOf('/auto') !== -1) {
    handlers.handleAuto(request, response);
  } else if (url.indexOf('/index.js') !== -1) {
    handlers.handleIndex(request, response);
  } else if (url.indexOf('/main.css') !== -1) {
    handlers.handleCSS(request, response);
  } else if (url.indexOf('/favicon.ico') !== -1) {
    handlers.handleFavicon(request, response);
  } else {
    response.writeHead(404, "Content-Type:text/html");
    response.end("<h1>Heather fucked up</h1>");
  }
}

module.exports = router;

favicon

please create a beautiful star favicon

Factor out your code in index.js

It'd be nice to have slightly purer functions - separate out the xhr request into its own function, and pass it a render function as a callback. Makes everything a bit easier to read too :)

Nice commits :)

The commit history is mostly really nice!

Almost every one references an issue. With just a tiny bit more work, you'd have had every single commit linked to an issue ๐Ÿ‘

selection_013

On a related note, I think @matthewdking has a problem with git because he's not showing up on the graph but definitely made commits:

selection_014

FAC11 had the same problem and there's a super easy fix, just grab me later and I'll sort it.

Tests!

Your app needs some tests!

You don't need to test the actual server (that's next week) but there's definitely some functionality that can be tested.

For example this bit of logic could be pulled out to a separate function and tested.

Autocomplete behaviour

Since it's an autocomplete, ideally you'd want to check the start of all the results in your text file, rather than looking for a match anywhere within each word. It would also be nice to be able to select a result and have it displayed in the search box or elsewhere.

DRY code in handlers.js

You can group all the files in "public" to one function, using an object with the different files, instead of creating multiple functions for that.

Remove readme images from the repo

The best way to save images that are just for the readme is to upload them to a github issue and then copy-paste the resulting link:

copy-paste

That way when people git clone the repo it doesn't come with a bunch of large images that aren't needed for the project to run.

Search bar

Should the search bar be in the middle?
Because it's not :/

Search box size vs. font-size

The search box is very big and the font size is pretty small. I would suggest changing one of them to match the other.

Autocomplete not 'completing'

At the moment the autocomplete is coming back with results but they're not feeding into the form. Ideally for this project you should have an autocomplete that manipulates an input. For example:

googlesearch

Add http:// to the console.log

Super minor thing but if you add http:// to the console.log in server.js it allows people to open the page directly from the command line:

start-http

Unpredictable autocomplete behaviour?

I'm not entirely sure how it's working - eg, if I type 'j' it gives me anything with j anywhere in it, but for others it only gives me at the start of a word

Results

Results are under the blue line, and so small and hard to readable

Search values that start with...

This is just a suggestion, but I think it is clearer and more useful if the results are the values that start with the user input and not values that have the input somewhere. But it is a matter of preference...

search bar glitch

when you write for example "lo" it shows everything with d and e results.. and you can't anything start with "l" or "lo"

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.