Open source enthusiast.

  • 13 posts
  • 7 comments
Joined 3 years ago
Cake day: August 19th, 2023
  • When you use query builder, you write a raw SQL code.

    The benifit is you can insert user input right in string, and your query remain secure against injections. Additionally, a Nano Queries let you compose queries, and extend it, so you may build complex queries simply.

    Let’s say you develop a site to search something by its features, for example a movies. Your SQL query may easy takes 100-500 lines. Some part of this query will be a basic, some will be optional depends on provided filters.

    With a query builder you may conditionally extend your query like that

    if (userInput.rating > 0) {
      filter.and(sql`rating >= ${userInput.rating}`);
    }
    

    That’s all Query Builder does. It let you avoid to write code like that

    const values = [];
    const getPlaceholder = (value) => {
      values.push(value);
      return `$${values.length}`;
    };
    
    const where = [];
    if (year) {
      where.push(`release_year = ${getPlaceholder(year)}`);
    }
    if (rating) {
      where.push(`rating >= ${getPlaceholder(rating)}`);
    }
    
    db.query(
      `SELECT title FROM movies ${where.length ? 'WHERE ' + where.join(' AND ') : ''} LIMIT 100`,
      values,
    );
    

Hi everyone. I’m launching Linguist Translate, an open-source, full-featured translation solution with an embedded offline translator based on the Bergamot Project created by Mozilla.

Site: https://linguister.io

GitHub: https://github.com/translate-tools/linguist

Today, Linguist is launched on ProductHunt. Support the project who really care about privacy: https://www.producthunt.com/posts/linguist-translate

Linguist is not just a wrapper over Google Translator like many other extensions. You can use any translation service with Linguist, thanks to custom translators! You may even deploy any machine translation (like LibreTranslate) on your localhost and then add this service to Linguist.

All features are included: text translation, full-page translation, selected text translation, Text-To-Speech, dictionary, history, and even more.

  • Sure, decision logs is just a step to fix a problems with decision making. Logs highlight a problems in decision making process and let you analyze a problems in your team. You still need an strong architect who may say “hey team, why your arguments so weak? it looks you are low skill engineers. make arguments more objective, or you will be fired” and then really fire weak engineers in team.

  • Exactly! I see how a mindset “we delivered (shit) quickly” successfully reproduces itself, over and over in a lot of companies.

    I think the actual reason is that business want to make money on promises right here right now. Business promises a lot of features to investors give money, and then business implement a lot of (shit) features. And then they continue kinda “okay, features broken, give us more money and we will fix it”.