#PHP #Laravel #Design Pattern: Improving #Telescope with Unorthodox #Decorator 🧩
When standard debugging tools couldn't handle a complex #API (JSON wrapped in Base64 wrapped in #SOAP), a creative solution emerged.
🧵 👇
#PHP #Laravel #Design Pattern: Improving #Telescope with Unorthodox #Decorator 🧩
When standard debugging tools couldn't handle a complex #API (JSON wrapped in Base64 wrapped in #SOAP), a creative solution emerged.
🧵 👇
Паттерны «Банды четырех»: примеры применения в реальном проекте
Как-то мне выпало написать небольшой микросервис, код которого практически полностью состоял их одних реализаций паттернов "Банды четырех". В этой статье я хочу рассказать о том, как последовательное решение поставленной задачи приводило к использованию все новых паттернов, и как эти паттерны взаимодействовали между собой. Будет много схем и кода, демонстрирующих практические примеры применения паттернов Композит, Билдер, Визитер, Цепочка обязанностей и Декоратор. Не смотря на то, что примеры кода написаны на PHP, статья может оказаться интересной и для разработчиков, использующих другие языки.
https://habr.com/ru/articles/888790/
#паттерны_проектирования #банда_четырёх #visitor #builder #composite #chain_of_responsibility #decorator
Revenge on the Wall: Painter’s Message Goes Viral in Bolsover
In January 2020, a quiet street in Bolsover, England, became the unlikely setting for a bold act of revenge that quickly made headlines across the UK.
When a dispute between a painter and his client reached boiling point, the result was a striking message that turned the town into the center of national attention.
The Dispute That Sparked It All
Dean Reeves, a professional painter and decorator, was hired to transform the exterior of the former North Star Club building, which was being converted into flats. Reeves claims that after completing the work, his client refused to pay £500 ($645) of the agreed fee. According to Reeves, he was asked to take on additional tasks beyond their initial agreement, with payment withheld until he complied.
Frustrated and feeling cheated, Reeves decided to make his dissatisfaction clear—on the very walls he had painted.
The Message on the Wall:
Frustrated and determined to make his point, Reeves took to the very canvas he had painted – the building’s exterior. His bold graffiti message read: “Want your house painting? Don’t be like Terry, pay the bill! Now you will!” The message, written in stark black paint, stood in sharp contrast to the freshly painted cream walls.
More: 7 Famous Street Art Pieces That Echo Environmental Awareness
The striking message didn’t just draw the attention of Bolsover residents – it captured headlines nationwide.
Featured prominently in newspapers like The Daily Mirror and The Sun, the story resonated with tradespeople and the public alike. Reeves’ actions sparked a mix of reactions, from those praising his ingenuity to others debating the professionalism of his response.
In Reeves’ own words, he decided to take action after being told repeatedly, “I’ll pay you tomorrow.” Tomorrow, however, never came. The building, which was being converted into flats, now served as a public reminder of the importance of honoring agreements.
Was Dean Reeves justified in taking this stand, or would you have handled the situation differently?
#Bolsover #decorator #england #graffiti #painter #paymentDisputes #StreetArt #tradespeople #viralStories
I don’t often decorate classes, but when I did, I didn’t have to
https://blog.narf.ssji.net/2024/11/30/i-dont-often-decorate-classes-but-when-i-did-i-didnt-have-to/
I have a few different classes implementing a specific behaviour, and want to find a specific one. What do I do?
Classes can be decorated in the same way as functions, and a decorated can be written to add each class to a list, for later searching.
However, for this stated purpose, it’s not necessary, as class inheritance is better suited, and parent classes have a __subclasses__ method returning a similar list.
I have a few different classes implementing a specific behaviour, and want to find a specific one. What do I do? Classes can be decorated in the same way as functions, and a decorated can be written to add each class to a list, for later searching. However, for this stated purpose, it's not necessary, as class inheritance is better suited, and parent classes have a __subclasses__ method returning a similar list.
Une exploration des possibilités offertes par les décorateurs JavaScript. Ils sont au stage 3 sur 4 de leur standardisation, mais sont déjà supportés par TypeScript et Babel.
J'ai toujours un peu du mal avec cette façon de faire. Je trouve que ça ajoute une couche de magie un peu trop abstraite et invisibilisée à mon goût, mais j'essayerai de m'y mettre.
Exploring the Possibilities of Native JavaScript Decorators – Frontend Masters Boost
https://frontendmasters.com/blog/exploring-the-possibilities-of-native-javascript-decorators/
From regular correspondent, Wayne Tanswell Signwriter, the many and varied services of E.F. Andrews, Felixstowe, Suffolk.
E.F. Andrews
Decorator, Plumber & Sanitary Engineer
Building & General Repairs
Rathbone Furnishing Stores
136 Hamilton Rd, Felixstowe IP11
Streetview: https://maps.app.goo.gl/6amaGByQ7Q16QzFY7
Photo: Wayne Tanswell, http://waynetanswell-signwriter.co.uk/
New blog post: Python CLI backward compatibility decorator
Click sometimes introduces too much coupling between the CLI and the underlying Python functions. It is possible to break this coupling using dedicated decorators, so we can refactor the Python code as needed withouth breaking the existing CLI usage.
https://blog.narf.ssji.net/2024/06/30/python-cli-backward-compatibility-decorator/
Click sometimes introduces too much coupling between the CLI and the underlying Python functions. It is possible to break this coupling using dedicated decorators, so we can refactor the Python code as needed withouth breaking the existing CLI usage.
Декораторы в python по книгам
С Python я знаком давно, в основном пишу бэкенд на Django. Сейчас работаю на нескольких работах, на одной выполняю роль бэкенд-разработчика, а на другой - лида веб отдела. Недавно наткнулся на тему в вузе, которую я давно хотел изучить - декораторы . Используются они много где, особенно удобно в фреймворках просто перед функцией написать какую-нибудь магическую строчку с @ и всё готово. Примерно понимал как они работают, но учиться никогда не поздно, так что попробую разобрать основные технические детали работы декораторов (только для функций). Статья подойдёт тем, кто просто зашёл узнать пару фактов про декораторы и хочет узнать синтаксис. Также раскрою немного глубже в техническую часть декораторов. Хорошие источники по этой теме - в конце. Также была использована великолепная статья: «Python декораторы на максималках. Универсальный рецепт по написанию и аннотированию от мала до велика» Узнать про декораторы
https://habr.com/ru/articles/817445/
#python_3 #decorators #decorator #декораторы #питон #книги_по_программированию #функции