typeofweb-org / devfaq Goto Github PK
View Code? Open in Web Editor NEWDevFAQ monorepo
Home Page: https://devfaq.pl
License: GNU Affero General Public License v3.0
DevFAQ monorepo
Home Page: https://devfaq.pl
License: GNU Affero General Public License v3.0
The problem goes deeper, it's because of the Next Redux Wrapper v6 upgrade.
Short term solution is to downgrade to v5.
Reproduction steps:
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"}
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.
This will also vastly simplify some pieces of the codebase:
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}' "
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.
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
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.
It has been noticed that while using Harmon758/[email protected] your postgresql password -api2018 is present in plaintext. Please ensure that secrets are encrypted or not passed as plain text in github workflows.
Dependabot couldn't resolve your project's dependencies as it couldn't access swagger-to-ts.
You can provide additional git credentials in your Dependabot dashboard by clicking into the account menu (in the top right) and selecting 'Config variables'. If you use a custom token for the host github.com
make sure it has read access to this repo, too.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.