vitonsky

Open source enthusiast.

Do not remove my spam

1mon 10h ago in fuck_ai from vitonsky.net

Do not remove my spam

1mon 10h ago in fediverse@piefed.social from vitonsky.net

Do not remove my spam

1mon 2d ago in technology@lemmy.zip from vitonsky.net

Do not remove my spam

1mon 2d ago in technology from vitonsky.net

Do not remove my spam

1mon 2d ago in programming@programming.dev from vitonsky.net

Nano Queries, a state of the art Query Builder

4mon 22d ago in programming@programming.dev from vitonsky.net

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,
);

Don't Guess My Language

1y 1mon ago in webdev@programming.dev from vitonsky.net

Now you may send link on this post to your manager, to justify a proper decision

Build Systems, Not Heroes

1y 8mon ago in programming@programming.dev from vitonsky.net

Definitely, you on the right way 😉

arrival-time, a simple and powerful progress time estimation (ETA) for JavaScript

1y 10mon ago in javascript@programming.dev from github.com

I like this meme. Essentially, current API let you express any operation measurement. If you know some case where this package does not work for you, you are welcome to issues.

Open-Source, Language-Agnostic Mutation Testing Tool Using LLM Agents

1y 11mon ago in webdev@programming.dev from github.com

AGPL license. No, thanks

Open-source and privacy focused offline translation in your browser

1y 11mon ago in linux@programming.dev from www.producthunt.com

Thank you too 👍

Open-source and privacy focused offline translation in your browser

1y 11mon ago in tech@programming.dev from www.producthunt.com

Yes, Linguist use Bergamot translator that is embedded in Firefox. But translation in Firefox in beta stage, it does not have a lot of features and does not support a lot of languages yet. Linguist is a full featured translator that support a lot of translation modules and even custom translators provided by users. So Firefox translation is just a subset of features from Linguist, like Firefox ads protection is just a small subset of features from uBlock Origin.

But Firefox translator are technological breakthrough anyway, so we appreciate it.

Software with politic opinion is a security threat

1y 11mon ago in privacy@programming.dev from vitonsky.net

There is no matter a motivation of products that play against its users. For the business important only the fact the companies is not reliable.

Software with politic opinion is are security threat

1y 11mon ago in programming@programming.dev from vitonsky.net

Well, the Linguist is no have any public opinion. You are welcome to use the unique project who care about UX, and don't care about political views of their users.

eslint-plugin-paths: A plugin for ESLint, to force use paths aliases from tsconfig

2y 2mon ago in cool_github_projects@programming.dev from github.com

Current plugin is just about force use aliases instead of relative paths (and back for deprecated aliases).

If you need to sort imports, you may try rule simple-import-sort/imports from https://github.com/lydell/eslint-plugin-simple-import-sortIt is very flexible, so you may customize your own groups. For instance, you may group aliases in one group and relative imports to another group. Check their docs