Git Product home page Git Product logo

devfaq's People

Contributors

adipol1359 avatar allcontributors[bot] avatar dependabot-preview[bot] avatar drillprop avatar fossabot avatar grzegorzpokorski avatar imgbot[bot] avatar mczeplowski avatar patrykbunix avatar przytrzask avatar survikrowa avatar tomson7777 avatar typeofweb avatar xstrixu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

devfaq's Issues

Add contributing.md

As the title says, it would be nice to list steps how to contribute to this project.

There are some templates on github like, for example, this one. I'm not sure what will fit to this project and how detailed should be. Maybe someone has bigger experience in contributing to open source. I think it requires discussion. I'll try to send some inspirations/templates too.

CI for the monorepo (part 2)

  • Configure CircleCI and Danger
  • Make sure deploys only restart api or www when there are changes
  • Add dependabot configuration for www and api

Cannot add a question

Reproduction steps:

  1. sign in
  2. fill in the add question form
  3. click submit
  4. nothing happens

network requests:

POST https://api.devfaq.pl/questions?
{"question":"Co to jest law of demeter?","level":"mid","category":"other"}

# response
{statusCode: 400, error: "Bad Request", message: "Invalid request payload input"}

Update next-redux-wrapper

The problem goes deeper, it's because of the Next Redux Wrapper v6 upgrade.

Short term solution is to downgrade to v5.

Mistake in test case Question #230

There is a mistake in this question.

image

It is written that "{dklf(df(kl))d]{}" is a valid test case while it is not due to the not opened "[".

Please update the question.

The code I used to test the cases:

const sum = (arr: number[]): number => arr.reduce((acc, el) => acc+el, 0);

type OpeningBracket = "(" | "[" | "{";
type BracketStackMap = Record<OpeningBracket, number>;

const checkBrackets = (str: string) => {
  const brackets = ["(",")", "[","]", "{","}"]; // "()[]{}".split("");
  
  const filtered = str.split("").filter(character => brackets.includes(character));
  const bracketsStack = new Map<BracketStackMap>([["(", 0], ["[", 0], ["{", 0]]);

  for(let i=0; i<filtered.length; i++){
    // could be simplified with closed/opening bracket key/value mapping
    const key = filtered[i] === ")" ? "("
          : filtered[i] === "]" ? "["
          : filtered[i] === "}" ? "{"
          : filtered[i];
    
    const currentVal = bracketsStack.get(key);
    
    // console.log({i, str: filtered[i], key})
    
    switch(filtered[i]){
      case "(":
      case "[":
      case "{":
        bracketsStack.set(filtered[i], currentVal + 1);
        break;
      case ")":
      case "]":
      case "}":
        bracketsStack.set(key, currentVal - 1);
        break;
      default: throw new Error(`Unhandled bracket: ${filtered[i]}`);
    }
    
    if(bracketsStack.get(key) < 0){
      // console.log("negative", bracketsStack.get(key))
      return false;
    };
  }
  
  return (sum([...bracketsStack.values()]) === 0);
};

const tests = {
  "{ac[bb]}": true, 
  "{dklf(df(kl))d]{}": true, //fails, should pass according to task description
  "{[[[]]]}": true,
  "{3234[fd": false,
  "{df][d}": false
};

Object.entries(tests).forEach(([test, expected]) => {
  const result = (checkBrackets(test) === expected) ? "✅" : "❌";
  
  console.log(`${result} "${test}" `);
});
// results
"✅ '{ac[bb]}' "
"❌ '{dklf(df(kl))d]{}' "
"✅ '{[[[]]]}' "
"✅ '{3234[fd' "
"✅ '{df][d}' "

[Idea] Add night/dark mode to website

It would be nice to add second theme of colors for people who couldn't stand code on white background because it is too bright for their eyes even it' s not.

[Idea] Search

Feature

Feature: Search engine

Given I'm a User
When I open the app
Then I want to be able to search for questions by their content

Questions

  • Should it search only in current technologies or all of them?
  • Should we use Algolia or implement it using PostgreSQL features?

Move DevFAQ into a monorepo

Why

In order to make project management easier, we need to merge both repositories (this one and https://github.com/typeofweb/devfaq-api) into a single monorepo.

Other benefits

This will also vastly simplify some pieces of the codebase:

  • Top level shared eslint config (+ overrides in api and www)
  • Topl level prettierrc
  • Single "dev" command to start both parts of the app
  • Easier to introduce changes which usually span across both api and frontend

Checklist

  • use this repo as a base
  • make sure it's clear in devfaq-api readme that the code was moved here
  • use yarn workspaces and maybe lerna
  • merge api and www GitHub Actions workflows into a single workflow with two parallel jobs
  • make sure commands such as dev and test can be run from the top level

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.