Monthly Archiv: November, 2021

PHP Find Text in Files

Package:
PHP Find Text in Files
Summary:
Search text in files like the Linux command
Groups:
Console, Files and Folders, PHP 5, Searching
Author:
Manolo Salsas
Description:
This package can search text in files like the Linux command...

Read more at https://www.phpclasses.org/package/12288-PHP-Search-text-in-files-like-the-Linux-command.html#2021-11-14-10:00:53

Laravel User Role and Permission

Package:
Laravel User Role and Permission
Summary:
Manage the user roles in Laravel applications
Groups:
Libraries, PHP 5, User Management
Author:
shamsh parvez
Description:
This package can manage the user roles in Laravel applications...

Read more at https://www.phpclasses.org/package/12287-PHP-Manage-the-user-roles-in-Laravel-applications.html#2021-11-13-20:57:18

State of the Word 2021

State of the Word 2021
State of the Word 2021 is happening Dec 14!

Howdy, World! 

Mark your calendars; it’s almost time for State of the Word 2021!

State of the Word is the annual keynote address delivered by the WordPress project’s co-founder, Matt Mullenweg. Every year, the event allows us to reflect on the project’s progress and the future of open source.This year will include that and more.

Due to the pandemic, we moved the State of the World online for the first time ever in 2020. This year, the event will be livestreamed from New York City .That will enable us to take as many folks as possible along for the ride!

Join Matt as he provides a retrospective of 2021, discusses the latest trends he’s seeing, celebrates the community’s amazing wins, and explores the future. Expect to hear about a range of topics, from WordPress 5.9 and Openverse to Web3 and non-fungible tokens (NFTs).

What: State of the Word 2021

When: December 14, 2021, between 10 am and 12 pm ET/3 pm and 5 pm UTC

How: If you’re watching from the comfort of your home or local watch party, the livestream will be embedded on wordpress.org/news.

Have a question for Matt?

State of the Word will be followed by a Question & Answer session. If you want to participate, you can either send your question ahead of time to ask-matt@wordcamp.org, or ask during the event in the livestream chat on YouTube.

If you’re new to State of the Word, the previous years’ recordings (below) will help you get a sense of what the event is about. Check them out:

We hope to see you online December 14th!

Thanks to @anjanavasan @eidolonnight @rmartinezduque for their work on this post. The featured image was created by @beafialho.

Laravel Telegram Bot

Package:
Laravel Telegram Bot
Summary:
Exchange messages between users using Telegram API
Groups:
Chat, PHP 5, Web services
Author:
Angel Campos
Description:
This package can exchange messages between users using Telegram API...

Read more at https://www.phpclasses.org/package/12286-PHP-Exchange-messages-between-users-using-Telegram-API.html#2021-11-12-12:43:53

PHP Tricks: Lazy public readonly properties

PHP Tricks: Lazy public readonly properties

I am apparently late in coming to this trick, but PHP 8.1 is going to make it even nicer to use.

A clever trick

There's an interesting intersection of functionality in PHP:

  • Declared object properties are more efficient than dynamic ones, because the engine can make assumptions about what data type to expect.
  • The magic `__get()` and `__set()` methods trigger when there is no property with a given name that has been *set*.
  • Fun fact: A property that has been declared but not initialized with a value is still technically "set"... to `uninitialized`.
  • However, you can `unset()` an uninitialized property.

That means you can do clever tricks like this (and some systems do, internally):

Continue reading this post on PeakD

Larry 12 November 2021 - 10:50am

PHP Tricks: Lazy public readonly properties

PHP Tricks: Lazy public readonly properties

I am apparently late in coming to this trick, but PHP 8.1 is going to make it even nicer to use.

A clever trick

There's an interesting intersection of functionality in PHP:

  • Declared object properties are more efficient than dynamic ones, because the engine can make assumptions about what data type to expect.
  • The magic `__get()` and `__set()` methods trigger when there is no property with a given name that has been *set*.
  • Fun fact: A property that has been declared but not initialized with a value is still technically "set"... to `uninitialized`.
  • However, you can `unset()` an uninitialized property.

That means you can do clever tricks like this (and some systems do, internally):

Continue reading this post on PeakD

Larry 12 November 2021 - 10:50am

Weekly News for Designers № 618

Envato Elements

Showcode – Create beautifully-styled code snippets, then export them as an image with this handy tool.
Example from Showcode

Bootstrap Icons – A free, open-source library of 1,500+ icons to use in your projects (Bootstrap or otherwise).
Example from Bootstrap Icons

10 Free WordPress Plugins for Extending BuddyPress and bbPress – Turn your WordPress website into an online community with these free plugins.
Example from 10 Free WordPress Plugins for Extending BuddyPress and bbPress

React Aria – A library of React Hooks from Adobe that provides accessible UI primitives for your design system.
Example from React Aria

Developer Tools secrets that shouldn’t be secrets – Get the inside scoop on what your browser’s developer tools are capable of.
Example from Developer Tools secrets that shouldn’t be secrets

8 CSS & JavaScript Snippets for Creating Incredible Lighting & Shading Effects – It’s now possible to add lighting and shading effects that are nearly on par with what we see in video games.
Example from 8 CSS & JavaScript Snippets for Creating Incredible Lighting & Shading Effects

Spectrum – Add a base color and this tool will generate an entire palette for you.
Example from Spectrum

A 10-step approach to inclusive branding, using the BBC as an example – A look at how the BBC put together its accessible branding.
Example from A 10-step approach to inclusive branding, using the BBC as an example

GUI Challenges – A collection of solutions to common interface challenges.
Example from GUI Challenges

Those Things You Must Do When Ending a Freelance Design Project – There are some important things that most designers never do when ending a freelance project. Here’s why you should make the effort.
Example from Those Things You Must Do When Ending a Freelance Design Project

Getting out of the Freelance Pricing Trap – Learn how to start charging what you’re truly worth.
Example from Getting out of the Freelance Pricing Trap

Jam – This Chrome extension lets you give lightning-fast feedback on live websites without the frustration of screenshots.
Example from Jam

HTML Forms Library – This library contains ready-to-use code for forms and works with popular frameworks.
Example from HTML Forms Library

CSS Buttons – Check out this open-source collection of button styles for every use case.
Example from CSS Buttons

Despite Its Critics, jQuery Forges Ahead – The popular JavaScript library is still in active development and in use by three-quarters of the web.
Example from Despite Its Critics, jQuery Forges Ahead

FlowBite – This open-source library features 400+ web components built with Tailwind CSS.
Example from FlowBite

How I made Google’s data grid scroll 10x faster with one line of CSS – This case study demonstrates the troubleshooting process and how to implement a solution.
Example from How I made Google’s data grid scroll 10x faster with one line of CSS

The post Weekly News for Designers № 618 appeared first on Speckyboy Design Magazine.

The Dependency Injection Paradigm

Paradigm; a nice word that means "a theory or a group of ideas about how something should be done, made, or thought about" (Merriam-Webster). In software development we have them too. From the philosophy and history of science courses I've followed, I remember that scientists working with different paradigms have great difficulty understanding each other, and appreciating each other's work.

Paradigm Shifts

An example of a paradigm is the theory that the sun revolves around the earth. To a certain extent this is a fruitful theory, and it has been used for thousands of years. There's of course another paradigm: the theory that the earth revolves around the sun. This is also a fruitful theory, and it can be used to explain a lot of observations, more than the previous theory. Still, people got angry with each other for moving the earth out of the center of the universe. Paradigm changes, or shifts, occur when the old theory has been stretched too much. It becomes impossible to hold on to it. Then some people start to experiment with a completely different paradigm, one that sounds totally weird, but in the end proves to have more power.

Now back to software development: we have paradigms and paradigm shifts too. For example, PHP went from being a very dynamically typed language to being a more statically typed language. This is weird for some, but great for others since it unlocks new possibilities, like static analysis and automated refactoring.

The DI Paradigm

Another paradigm shift happened years ago when we went from symfony1 to Symfony 2, which introduced the Dependency Injection container. The idea of Dependency Injection was quite new to many developers back then, and we had to talk and read about it a lot before we were ready for this amazing yet weird concept. What got in the way of adoption, I think, was the Yaml or XML syntax for service definitions, an approach that was probably copied from Spring. If we'd start by writing our own service containers in plain PHP, that would've been much easier to learn and do.

What's interesting to me is that Symfony's first DI container was showing some influence from the old paradigm, e.g.

  • Singleton services: most services are instantiated only once, which allows for stateful services, mimicking the actual singletons from before.
  • The container had services that aren't services (e.g. the current HTTP request object).

Nevertheless, we got a taste of DI: expect your dependencies to be injected, instead of having to fetch them yourself. This changes everything!

  • Dependency injection is inversion of control: a service doesn't have to be worried about setting up a dependency, it can just declare it, and it will be taken care of.
  • Depending on an interface gives the developer the option to switch out implementations, for whatever reason.
  • Looking at the constructor signature, you can get some idea of what the service is going to do, and a complete overview of what it needs.
  • If a class is not a service, you can't give it service dependencies. This makes it absolutely clear what type of object a class represents: it's either a service, or some other object like an entity, or a value object.

I was totally convinced that the Dependency injection paradigm was a step forward, out of the land of unclear dependencies and tightly coupled classes. And I thought every other developer would like it too. Surprisingly, the introduction of a new framework - Laravel - revived the old paradigm, and with great success. It's surprising because a paradigm shift isn't often reverted. In science, the paradigm shift indicates a step forward, towards a theory that can explain more phenomena than the previous paradigm could. In programming, it turns out, you can have developers working with different paradigms, and even arguing that neither of those paradigms is a step forward compared to the other.

Crossing the Bridge

When I, as a developer from the DI paradigm, talk to someone who uses another paradigm, I find it really hard to come to some form of understanding. The assumptions, the goals, the theories that each of us uses, are very different. I find this very hard to deal with. We talk about a piece of code and I see lots of problems with it, but there is no common ground that can help us settle the debate. Personally I'm sad about this, because I don't really know how to improve the situation. You can keep fighting, and this happens a lot (e.g. on Twitter, Reddit), but since developers use completely different paradigms, I think that produces only negativity. In the case of "S

Truncated by Planet PHP, read more at the original (another 1699 bytes)

Take the 2021 WordPress Annual Survey (and view the 2020 results)!

Each year, members of the WordPress community (users, site builders, extenders, and contributors) provide their valuable feedback through an annual survey. Key takeaways and trends that emerge from this survey often find their way into the annual State of the Word address, are shared in the public project blogs, and can influence the direction and strategy for the WordPress Project.

Simply put: this survey helps those who build WordPress understand more about how the software is used, and by whom. The survey also helps leaders in the WordPress open source project learn more about our contributors’ experiences.  

To ensure that your WordPress experience is represented in the 2021 survey results, take the 2021 annual survey now.

You may also take the survey in French, German, Japanese, Russian, or Spanish. These are the top five languages (other than English) based on the number of WordPress locale downloads. For 2022, additional languages may be considered for translation.

The survey will be open through the end of 2021, and the results will be published in a future post on this blog for anyone to view. Next year, there will be a new format for this survey, including which segments and questions are included, so that your valuable time spent responding results in equally valuable information.

2020 Survey Results

For the 2020 survey, more than 17,000 responses were collected, representing the highest submission volume in four years, up three times from the prior year. In the inaugural year of the survey (2015), over 50,000 responses were collected. Given the reach and adoption of WordPress, there is significant significant number we have not reached. As you take the 2021 survey, consider sharing the link on social media and with other colleagues who use WordPress. Gathering feedback from more folks who benefit from WordPress will strengthen our project.

The 2020 survey results show that the pandemic has had a major impact on how we operate as a community. With few in-person events, many community members continue to find it challenging to balance community contributions with their own personal and professional obligations. 

Footnotes:

Data security and privacy are paramount to the WordPress project and community. With this in mind, all data will be anonymized: no email addresses nor IP addresses will be associated with published results. To learn more about WordPress.org’s privacy practices, view the privacy policy.

Like last year, the 2021 survey will be promoted via a banner on WordPress.org, and throughout the make blogs. However, taking a moment to amplify these posts through your own social media and Slack accounts will ensure broader participation. Each of the translated surveys will be promoted through banners on their associated localized-language WordPress.org sites.

Thanks to @dansoschin for the initial draft of this post, and to @annezazu & @zackkrida for review!

Powered by Gewgley