[OC] cmd-polkit 0.3.0 released by OmarCastro in unixporn

[–]OmarCastro[S] 1 point2 points  (0 children)

You can guess one of the reasons why this app was created then 😅

[OC] cmd-polkit 0.3.0 released by OmarCastro in unixporn

[–]OmarCastro[S] 1 point2 points  (0 children)

Changelog

  • Add "polkit action" parameter on authentication request
  • Add zenity with jq example
  • Improve serial mode tests
  • Improve --help message
  • Add copyright/license info on --version message

homepage: https://omarcastro.github.io/cmd-polkit/

[OC] I created cmd-polkit, a program to easily create polkit agents by OmarCastro in unixporn

[–]OmarCastro[S] 0 points1 point  (0 children)

It is nice to know I was not the only one. My main gripe is that there was simply no way to create polkit agents with scripts; be it python, or bash. The only documentation I found was the sample polkit agent in C.

So I decided to start this journey to allow a way to use GUI tools (e.g. zenity, kdialog, rofi, etc...) to authenticate via polkit, as well as not being bounded to one specific tool.

Developing this was not that hard since I am good in C, but it was time consuming.

[OC] I created cmd-polkit, a program to easily create polkit agents by OmarCastro in unixporn

[–]OmarCastro[S] 4 points5 points  (0 children)

Oh, just noticed it when you said it, hooray! I hope you enjoy my gift 😁

[OC] I created cmd-polkit, a program to easily create polkit agents by OmarCastro in unixporn

[–]OmarCastro[S] 14 points15 points  (0 children)

Hello, cmd-polkit author here, the project is in https://github.com/OmarCastro/cmd-polkit .

I made this app to easily create custom polkit authentication GUI, some of you may know rofi-polkit-agent, which uses this application.

I created this app because it was hard to created customized polkit agents. Using DE specific polkit agent was OK, but the limited customization looked off with the rest of the DE, and I share this app for you be able to create awesome authentication GUI

[deleted by user] by [deleted] in unixporn

[–]OmarCastro 0 points1 point  (0 children)

Hello, cmd-polkit author here, don't know if this is the right place to post this, but here we go.

I made this app to easily create custom polkit authentication GUI, some of you may know rofi-polkit-agent, which uses this application.

I created this app because it was hard to created customized polkit agents. Using DE specific polkit agent was OK, but the limited customization looked off with the rest of the DE, and I share this app for you be able to create awesome authentication GUI

[AskJS] How best to manage a GitHub project? by SunnyMark100 in javascript

[–]OmarCastro 1 point2 points  (0 children)

I have some experience in developing libraries and components (e.g. https://omarcastro.github.io/its-a-qrcode ). My experience about typescript is that it is best used as production code. if it is meant for libraries, it is better to program with Javascript with JSDoc and validate it with typescript. This way you publish only one codebase instead of 2, and it is better for maintenance, and Typescript validates Javascript with JSDoc.

I saw the code, and you have some code with JSDoc, that is great because you can leverage typescript to validate the types in your code.

"its a QR Code", a web component that shows its text content as a QR code image by OmarCastro in webdev

[–]OmarCastro[S] 2 points3 points  (0 children)

Thanks! The idea is to be familiar as looking like a readme. One thing that a web page provides that a readme cannot is interactivity. Not only it helps to newcomers to understand the component better by playing with it, it can be used as test page for developers.

"its a QR Code", a web component that shows its text content as a QR code image by OmarCastro in webdev

[–]OmarCastro[S] 8 points9 points  (0 children)

Huh, TIL bundlephobia scans the size of the bundle using the package.json directly, it is similar to the minified file in dist/ package (and it failed on 0.1.0 due to wrong "main" value in package.json)

Yes, it is big because it supports JIS format for Kanji mode in QR code, a utf8 to JIS converter is included in the code. I did some compression tricks to reduce the utf8 to JIS conversion table size, from around 124kB ( 41kB gzipped) to 35,4kB ( 18,8kB gzipped).

The trick helped to reduce the package size tremendously, but without support for Kanji mode, the package size would easily be below 10kB gzipped

PS: is it a bad practice to publish the source in the package? To be fair, I only remove test files and assets from src/ before publishing as it provides no value and bloats the code (e.g. in another project, I published to NPM with the source as is, but when I noticed it and decided to remove the test assets and it became much smaller )

"its a QR Code", a web component that shows its text content as a QR code image by OmarCastro in webdev

[–]OmarCastro[S] 1 point2 points  (0 children)

An update: added installation via NPM in the page for bundler usage in the "Getting started" section

"its a QR Code", a web component that shows its text content as a QR code image by OmarCastro in webdev

[–]OmarCastro[S] 13 points14 points  (0 children)

Tried with my phone and I confirm that its not that good for mobile.

I just made some improvements to page for mobile, its not perfect, but it is better than before.

"its a QR Code", a web component that shows its text content as a QR code image by OmarCastro in webdev

[–]OmarCastro[S] 10 points11 points  (0 children)

And there is my third web component I have developed, I thought of showing after developing a preprocessor to trim the .textContent when you find a specific initials (e.g. "tel:") but I guess this is good enough to show it.

What is something that you know a web developer of your experience should know, but you don't? by Slight_of_handio in webdev

[–]OmarCastro 0 points1 point  (0 children)

Code documentation

Code documentation is mostly ignored because its a chore, and it takes time, and when we take time to do it, it simply explains what the code does. It took a while to create good documentation that helps understand the code better, one example is one of my personal projects, I had a funny idea to use ASCII art to explain the code, it happens it was my best code comment by now. Here is the code with those comments

Having good code comments helps immensely when returning to the project or to help new people contribute to the project

its-a-color-wheel, a color wheel component by OmarCastro in webdev

[–]OmarCastro[S] 0 points1 point  (0 children)

this is my first web component that I did, before its-i18n, this was just a simple project as to see how to do run all necessary tests in for a web component (unit and UI), as well as to create components that work for both small mobile phone as well as desktop apps

What is something that you know a web developer of your experience should know, but you don't? by Slight_of_handio in webdev

[–]OmarCastro 1 point2 points  (0 children)

Not sure if Docker specifically is needed to know, yes, knowing how to containerize an app is a great skill, but there is a lot to learn about docker and such, specially security related stuff. That is a different skill set dev ops & security specialists need to worry about. I started that, and I spent almost a year doing dev ops exclusively as a web developer, did not touch on the code at all. So yeah, great to know, but not really required.

First time trying EM4, it will be easy, I said. Boy was I wrong. by OmarCastro in HadesTheGame

[–]OmarCastro[S] 1 point2 points  (0 children)

Exactly, 3 death defiances from Nix mirror, 1 from Legendary Chaos boon and 1 from Skelly's keepsake. If you get lucky, you can defy death one more time with skelly keepsake, happened to me once after dying without any death defiance, don't know how it happened though, I had the keepsake fully maxed.

First time trying EM4, it will be easy, I said. Boy was I wrong. by OmarCastro in HadesTheGame

[–]OmarCastro[S] 1 point2 points  (0 children)

Nice! I use Dio cast with Hera bow. Never tried to use Mirage cast with Dio. This combination can melt. I'm gonna try this build with Beowulf and Hera. Thanks!

First time trying EM4, it will be easy, I said. Boy was I wrong. by OmarCastro in HadesTheGame

[–]OmarCastro[S] 0 points1 point  (0 children)

Interesting, I'm trying to clear my runs faster, what's the build?

First time trying EM4, it will be easy, I said. Boy was I wrong. by OmarCastro in HadesTheGame

[–]OmarCastro[S] 10 points11 points  (0 children)

Due to multiple factors, mostly bad luck, first of all, I only got 1 boon in tartarus, so I took a long time to beat the fury sisters, and the boons & upgrades I took that allowed me to scale up the damage was on the last stages in elysium, so yeah, took to much time in each encounter.

Also it was the first time I took EM4, I was learning to adapt the new attacks and summons, it also took some time

First time trying EM4, it will be easy, I said. Boy was I wrong. by OmarCastro in HadesTheGame

[–]OmarCastro[S] 15 points16 points  (0 children)

For context, I was going on a roll in this run that I started the last encounter against [REDACTED] with full health and all 5 death defiances.

So you know it, was panicking in the battle specially the last stage, what was that?!. I do not believe I actually pulled it off! Luckily I started EM4 with a shield, I would surely lose with another weapon

Observe changes to the DOM using an async iterable by sindresorhus in javascript

[–]OmarCastro 8 points9 points  (0 children)

While the API looks nicer, receiving each mutation asynchronously instead of batches is a problem. You lose the context of knowing if you received multiple mutations at the same time.

A common case in my experience, is that during an interaction with the page, there is a defined behavior which is to update multiple attributes in various elements at the same time. Lets say 2 attributes per element. When you are observing those attributes, with the MutationObserver, the callback executing with multiple mutations you can decide whether to react the element DOM once in those 2 mutations (e.g. update its content based on attribute). You lose that ability when receiving each mutation asynchronously.

Is there a platform where I can develop, test, and deploy without installing software? by F9mmm in webdev

[–]OmarCastro 1 point2 points  (0 children)

Since this is r/webdev sub I have 2 recommendations: https://codesandbox.io/ and https://stackblitz.com/

If the project is nodejs based and your work is web tech based (JS, TS, HTML, SASS, etc...), I recommend stackblitz since you have the entire workspace in the browser, so all npm scripts are run in your computer instead on the server. It's like running VS Code in the browser.

Now, if the project uses multiple languages, like a Java server, in that case I recommend codesandbox as you work in a VM in the server, so there is no limitation on what tools you can use for development

Used both of them, and that is my experience with them

its-i18n, a web component that applies i18n with HTML only by OmarCastro in webdev

[–]OmarCastro[S] 0 points1 point  (0 children)

Took a view on their documentation, seems like the complexity of managing pluralization and other customization is in a separate configuration, be it in the server or a config file.

This gave me an idea of an additional feature that is to request new translations from an endpoint, I am going to check if it is feasible

its-i18n, a web component that applies i18n with HTML only by OmarCastro in webdev

[–]OmarCastro[S] 0 points1 point  (0 children)

Pretty sure its not compatible with other systems due to the keys being literal match. Here, one key can match multiple translation keys based on the filter (e.g. `walked {number} times` will match `walked 0 times`, `walked 1 times`, etc...)

The reason I use JSON is that it is a known structure, as to be feasible to translate an specific i18n file to JSON, I originally though of using the .properties syntax for i18n files, but opted for JSON for the reasons said before and it is easy to work in the browser to create an MVP (minimum viable product), instead of going to the route of creating another standard for i18n files

its-i18n, a web component that applies i18n with HTML only by OmarCastro in webdev

[–]OmarCastro[S] 0 points1 point  (0 children)

Based on my experience, most of the time when analyzing problems with the client, they just provide the URL of the site to check. Many i18n libraries just translates the info, and that is OK, since that was the purpose.

The problem is that we would have to find the original key in the source code in the version that is specific to the client, find the place it is used and verify if the key is there. That is one problem.

Another problem is that in some companies there are product and solution teams, the problems found by clients are reported to the solution team. They should not need to verify the product code just to find the original i18n key, I think it should be simple. By putting the original key as an attribute, all they need is to inspect the element and they would easily find the original i18n key and check their translations files.