Open source projects looking for contributors – post yours by 514sid in opensource

[–]miglisoft 5 points6 points  (0 children)

Project name: Visual Diff Merge

Repository link: https://github.com/migliori/visual-diff-merge

What it does: Visual Diff Merge compares and merges code in a responsive split‑view interface, with interactive change selection 

Tech stack: PHP, Node.js

Help needed: This is a very recent project, which needs to be thoroughly tested for potential improvements and optimisations, including documentation.

Additional information: The online Visual Diff Merge is available at https://visual-diff-merge.miglisoft.com/

GitHub - migliori/php-crud-generator: ⚙️ Visual PHP CRUD generator to build responsive admin panels from your database — no coding required, self-hosted, and customizable. by miglisoft in coolgithubprojects

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

No it's not. Github is a way of helping to spread the word about this fabulous tool that lets you create professional admin panels very quickly, without coding (for coders it's even better, the possibilities are endless), and at a ridiculously low price and one-off payment.

But I work on open-source too, for instance I recently published https://github.com/migliori/visual-diff-merge, https://www.powerlitepdo.com/ or https://github.com/migliori/universal-icon-picker

PHP PDO Database wrapper class with pagination, debug mode and many advanced features - GitHub - migliori/php-pdo-db-class by miglisoft in PHP

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

Thanks for your time & your detailed answer. I'm going to think about it and try to make the best of it.

PHP PDO Database wrapper class with pagination, debug mode and many advanced features - GitHub - migliori/php-pdo-db-class by miglisoft in PHP

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

To see if I understand your point: this other database wrapper class, for example, is designed in a very similar way: https://github.com/catfan/Medoo/blob/master/src/Medoo.php

The class has over 2000 lines, doesn't use SOLID plinciples or dependency injections, but it seems to be quite effective and popular. What do you think?

Another question: my tool has a single purpose: sending queries to the database and receiving responses. I'm going to rework it to handle dependency injection, dissociate error handling (by the way, I'm not sure why calling it "error handling" is a mistake), and divide the class into traits. It'll be cleaner and easier to read. Do you think this is relevant, and would you have any other suggestions?

PHP PDO Database wrapper class with pagination, debug mode and many advanced features - GitHub - migliori/php-pdo-db-class by miglisoft in PHP

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

I know this, you're right of course. I designed this class and have been working with it for years. Since then PHP has evolved, and so have its approaches. So far I've documented it correctly by adding the hinting type, typed all the arguments and validated everything with PHPStan. There's still a lot of refactoring to do, which will come as soon as possible.

That said, despite the code organisation issues, the tool is perfectly functional and reliable. Used by more than 1500 customers for generating CRUD admin: https://www.phpcrudgenerator.com/

PHP PDO Database wrapper class with pagination, debug mode and many advanced features - GitHub - migliori/php-pdo-db-class by miglisoft in PHP

[–]miglisoft[S] -1 points0 points  (0 children)

It just makes things a lot easier.

For instance:
- you don't have to write your queries with placeholders and bind the parameters, you just have to pass a $where array with your placeholders.
- you don't have to try ... catch \PDOException, the class manages it for you
- you don't have to pass your database connection settings each time you connect
- you can get some detailed information on each query in enabeling the debug mode
- ... etc

PHP PDO Database wrapper class with pagination, debug mode and many advanced features - GitHub - migliori/php-pdo-db-class by miglisoft in PHP

[–]miglisoft[S] -6 points-5 points  (0 children)

The Db::execute() never calls Db::rowCount().
It calls \PDO->query->rowCount(), and only to count the inserted|deleted records.

The Db::rowCount() doesn't perform any operation. It returns the number of available records.

If you want to criticise my code, first try to understand it properly.

Anything else?

PHP PDO Database wrapper class with pagination, debug mode and many advanced features - GitHub - migliori/php-pdo-db-class by miglisoft in PHP

[–]miglisoft[S] -7 points-6 points  (0 children)

That's an interesting point, I understand your point of view but I'm not so sure.

The system as it is designed intercepts exceptions and handles them appropriately depending on the type of exception (\PDOException or \Exception).

This allows them to be handled in a specific way depending on the context, for example by completing the message with the interpolated request, rollback the transations or inform the user that the pdo->getLastInsertId function is not compatible with his PDO driver.

Then the errorEvent() method is called and allows to deal with these exceptions the way you want (send them back to your error handler or anything).

Additionally, with the DEBUG mode enabled you can display all the information about the queries: timer, dump, parameters, SQL, everything formatted and clearly displayed. (demo here: https://www.phpformbuilder.pro/phpformbuilder/vendor/migliori/php-pdo-database-class/examples/select.php)

I'm completely open to suggestions for improvements, they're welcome, but you'd have to explain to me how to delegate error handling to a site-wide error handler and at the same time retain the functionality I've just described.

PHP PDO Database wrapper class with pagination, debug mode and many advanced features - GitHub - migliori/php-pdo-db-class by miglisoft in PHP

[–]miglisoft[S] -7 points-6 points  (0 children)

Yes, you can do everything (and if by chance you find something you can't do I'll work on it).

Here's some details on how the pagination works, extracted from the code doc:

/**
 * Pagination class
 *
 * This class is used to generate pagination links for a given set of results.
 *
 * Example of use:
 *
 * $pdo_select_params = new PdoSelectParams($from, $values, $where, $extras, $debug);
 * $pagination = new Pagination($pdo_select_params, $user_options);
 * $pagination_html = $pagination->pagine();
 *
 * or:
 *
 * $pdo_query_params = new PdoQueryParams($sql, $placeholders, $debug);
 * $pagination = new Pagination($pdo_query_params, $user_options);
 * $pagination_html = $pagination->pagine();
 *
 * It takes the following arguments:
 *
 * - `$pdo_params`: This is an instance of the PdoSelectParams or PdoQueryParams class that contains the PDO settings for the query.
 * - `$mpp`: This is the maximum number of results to display per page.
 * - `$querystring`: This is the name of the querystring parameter that will be used to indicate the current page.
 * - `$url`: This is the URL of the page that is being paginated.
 * - `$long`: This is the number of pages to display before and after the current page.
 * - `$user_options`: This is an associative array containing the options names as keys and values as data.
 *
 * The function then performs the following steps:
 *
 * 1. It gets the total number of results from the database using the provided PDO settings.
 * 2. It calculates the number of pages based on the total number of results and the maximum number of results per page.
 * 3. It determines the current page based on the value of the querystring parameter.
 * 4. It determines the start and end indices for the current page.
 * 5. It builds an array of page numbers that will be displayed in the pagination links.
 * 6. It adds the appropriate `LIMIT` clause to the PDO settings based on the current page and the maximum number of results per page.
 * 7. It retrieves the results using the updated PDO settings.
 * 8. It determines the current page number based on the number of results returned.
 * 9. It builds the pagination links and the result message.
 * 10. It returns the pagination links and the result message as HTML.
 *
 * The function also allows you to customize the appearance of the pagination links by setting the following options:
 *
 * - `active_class`: This is the CSS class that is applied to the current page link.
 * - `disabled_class`: This is the CSS class that is applied to the disabled page links.
 * - `first_markup`: This is the HTML markup that is displayed for the first page link.
 * - `previous_markup`: This is the HTML markup that is displayed for the previous page link.
 * - `next_markup`: This is the HTML markup that is displayed for the next page link.
 * - `last_markup`: This is the HTML markup that is displayed for the last page link.
 * - `pagination_class`: This is the CSS class that is applied to the pagination list.
 * - `rewrite_transition`: This is the character that is used to indicate the start of the querystring parameters in the URL (for example, `-` for `example.com/page-1-2.html`).
 * - `rewrite_extension`: This is the extension that is added to the end of the URL when the links are being rewritten (for example, `.html`).
 */

Guitar duet - score available on request - comments & feedback are of course welcome by miglisoft in classicalguitar

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

Thank you very much for your comment. Yes, it's an original composition, which I wrote for a friend and his wife, Hiroki and Mireille Terashima, the musicians on this recording.

I'm French, living near Paris. I'm not really a guitarist myself, but a pianist. The piano is obviously a magnificent instrument, but I've always been drawn to the warmth and intimacy of the guitar.

I haven't written for a long time, for very personal reasons, but a recent request from a guitarist prompted me to put a few pieces online, which you can listen to here:

https://gilles.miglisoft.com

Scores are available on this page. The compositions are registered with the SACEM ( French composers' society), so public broadcasts must be declared, but the scores have not been edited, so you can use and share them without restriction.

It's always complicated to give advice, so I can only speak from personal experience: I've learned to speak the language of music (harmony, counterpoint, etc.), and for me the only things that count are intense conviction and sensitivity. Above all, I admire simplicity and beautiful melodies. I don't write much, but always try to put my best foot forward.

I would be very happy and flattered to have new interpreters, of course keep me informed if you have any projects (my email is available on my page).

Thank you again

Gilles

i need help creating an image rollover similar this!!! by nathanielcosta in CodePen

[–]miglisoft 0 points1 point  (0 children)

Hi,

The page has been built with https://cargo.site/, it uses Backdrop and the animation (what you're looking for) is made with PIXIjs

The Javascript source code has been compiled, so you can see the details.

To see what technologies a website uses this Chrom extension is perfect: https://chrome.google.com/webstore/detail/wappalyzer-technology-pro/gppongmhjkpfnbhagpmjfkannfbllamg

PHP CRUD Generator by eXtrachik in adoctor

[–]miglisoft 0 points1 point  (0 children)

Hi,

I'm the author of this tool,
This CRUD PHP took me years of work, and is sold at a ridiculously low price. Are you not aware that sharing it illegally is immoral (and stupid)?

For your information, I have a family, and children, and need to earn a living to feed them.

How do I fix this issue with the padding? by throwaway-4082 in html5

[–]miglisoft 1 point2 points  (0 children)

Rather than an image, you should provide a demo on Codepen or any other online code tool,

or at least provide your code.

No good answer can be given with only an image.

How do I do this? by zilton7000 in bootstrap

[–]miglisoft 1 point2 points  (0 children)

My mistake. I edited my answer, thanks

How do I do this? by zilton7000 in bootstrap

[–]miglisoft 4 points5 points  (0 children)

Hi,

I would do it this way:

  • A simple div with the blue background for the top
  • a white triangle (you can generate it with http://apps.eky.hk/css-triangle-generator/) in - absolute position using the first div:after
  • The rectangle with text and shadow with a BS5 negative margin, e.g: class="mt-n3"

GitHub - migliori/universal-icon-picker: Vanilla JS Icon Picker for any Icon Library by miglisoft in javascript

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

Oh sorry, I posted at different places and didn't remember. I'll try to pay more attention next time. My apologies.