background preloader

Domnikl/DesignPatternsPHP: sample code for several design patterns in PHP

Domnikl/DesignPatternsPHP: sample code for several design patterns in PHP
Related:  twimm

Programming: doing it more vs doing it better – Kevin Martin Jose A few years ago, very early into my programming career, I came across a story: The ceramics teacher announced on opening day that he was dividing the class into two groups. All those on the left side of the studio, he said, would be graded solely on the quantity of work they produced, all those on the right solely on its quality. His procedure was simple: on the final day of class he would bring in his bathroom scales and weigh the work of the “quantity” group: fifty pound of pots rated an “A”, forty pounds a “B”, and so on. This little story has had a tremendous impact on how I approach software engineering as a craft. Three years later, I am still very much the apprentice. Today, I came across an essay that would let me resign from my perpetual struggle to “get faster” at engineering: I used to have students who bragged to me about how fast they wrote their papers. Put more thought into the design of your systemsRefactor liberally and lavishlyTest thoroughlyTake your sweet time

ziadoz/awesome-php Don’t trust agile alone to build successful products Ryan Singer illustrates this dilemma perfectly in what he calls the hill chart. The hill chart implies that we need to do hard uphill work to set ourselves up for frictionless downhill execution. It implies that we need to do actual work to figure out the best way to implement an idea before we start doing to work to implement it. When we only think and about how were are going to implement something without testing it first, we position the work at the top of the hill instead of at the bottom of the hill. Then we skip doing work to figure out how to best implement it. When that happens, we tend to get stuck during implementation. The solution is to start at the foot of the hill. No matter what happens in a project, we are bound to get stuck at some point in time. A much better time to get stuck, is when you are stilling figuring things out.

Sculpin — PHP Static Site Generator azdanov/php-interview-exercises: Some exercises to practice whiteboard interview questions in PHP Gumdrop - Static website generator using Markdown and Twig php -r "$(curl -s -n +2)" curl -sS | php php composer.phar create-project simonjodet/gumdrop_blog_template myblog cd myblog _vendor/bin/gumdrop -rw Where myblog is the folder where you want to create your blog (you can rename the folder later). Gumdrop requires PHP 5.3 with CLI support. However PHP 5.4 is recommended in order to get the built-in web server option. If you're using Linux, your distribution most likely has a PHP CLI package for you to install. If you're using Mac OS 10.7.x (Lion), PHP 5.3 is already installed. Gumdrop has not been tested on Windows and most probably doesn't work. Once in a while, you should run the following command in your Gumdrop-based project: php composer.phar update You'll get the latest features. Gumdrop is intended to build any kind of web site. Default setup You can render your site with following command: _vendor/bin/gumdrop Two command-line options are available: r and w: Example

JQuery et Ajax - code snippets pour tous les jours - Zen Devs Le terme AJAX a été inventé il y a douze ans pour décrire une méthode de récupération de données à partir d’un serveur sans nécessiter de rafraîchissement de page. Parmi plusieurs autres fonctionnalités incroyables, jQuery est connu pour rendre l’ensemble du processus AJAX plus simple.Dans cet article, j’ai compilé des extraits de code prêts à utiliser pour les besoins quotidiens: envoi de données avec la méthode GET et POST, récupération de texte ou Json à partir de pages distantes, et plus encore. Remarque: cet article n’utilise pas le raccourci $ pour l’objet jQuery . Envoyer des données en utilisant la méthode GET jQuery.get() est une fonction abréviation AJAX, qui charge les données du serveur à l’aide d’une requête HTTP GET. Envoyer des données en utilisant la méthode POST Similaire à jQuery.get(), jQuery.post() charge les données du serveur à l’aide d’une requête HTTP POST. Récupération de texte à partir d’une page Web Voici un extrait super pratique que j’utilise très souvent.

HybridAuth, Open Source Social Sign On PHP Library Devenez un meilleur développeur grâce aux bonnes pratiques Ces dernières semaines, j'ai passé pas mal de temps à lire et étudier des articles de blogs, des projets github, des ebooks à la recherche de bonnes pratiques. J'ai toujours été attiré par les principes de code qui peuvent m'aider à faire du "Beau Code". Faire en sorte que je sois fier de montrer mon code à d'autres développeurs, que je ne m'arrache pas les cheveux lorsque je dois reprendre un projet codé il y a deux mois, que les devs passant après moi ne souhaitent pas ma mort et que mon code soit tellement beau que l'on puisse le photographier. J'ai cherché principalement en swift, javascript et php mais les principes de code, les bonnes pratiques ne sont pas cloisonnées à un langage. On va donc se faire un petit résumé de ce que j'ai pu retenir de tous ces articles. DRY Approach Ce principe est simple et semble même logique mais il y a trop de cas où les développeurs ne l'appliquent pas. Indenter son code Je suppose que tout le monde ici indente son code... Utiliser des constantes

40 nouveaux packs d'icônes flat design à découvrir Le flat design connaît un succès fulgurant au sein de la communauté du Web design. Le flat n'en est qu'à ses débuts et aucun indice ne préfigure un abandon soudain de ce courant faisant la part belle aux couleurs vives, à la typographie et à l’espace. Dans cet article, j’ai rassemblé une importante collection d’icônes flat pour la conception de vos futures interfaces graphiques. Cette liste offre de merveilleuses combinaisons d’icônes flat designées pouvant être utilisées dans une grande diversité de projets. Ces packs conviendront parfaitement aux personnes en recherche d’icônes dans les thématiques Communication, bureautique, développement, e-commerce, social media, navigation, affichage… la liste est longue. De plus en plus d’applications Web adoptent ce concept. L’emploi d’icônes originales, les variations de couleurs, l’utilisation harmonieuse de photographies et de fontes sont les seuls moyens à notre disposition pour sortir du lot. Icônes flat designées par Mike Clarke

UX Responsibilities in Scrum Ceremonies Shifting from traditional product-development processes like Waterfall to modern Agile frameworks such as Scrum can be a challenge for UX. We must learn a whole new set of nomenclature, adapt to new timeframes in which to complete our research or design work, and step outside of our comfort zones to collaborate with cross-functional partners, many of whom we’ve never worked with before. Once we start making these changes, we quickly realize there’s a lot more to Agile than simply working in time-boxed sprints. Unlike Waterfall, Scrum has many recurring meetings that are typically referred to as ceremonies, including daily standups (also known as daily Scrum), backlog refinement (also known as backlog grooming), sprint planning, demos, and retrospectives. UX Should Be Present and Engaged at Ceremonies UX involvement on an Agile team means more than just working a sprint ahead to quickly and continuously deliver ideas to product owners, stakeholders, and developers. Standup (Daily Scrum)

10 PHP code quality tools to avoid a mess in your projects | Gabriel Saldaña's blog When programming in any language there are certain common errors that everyone makes as they mature and evolve their programming skills. In the case of PHP, I’ve seen a lot of ugly and complicated code around, since the language is very permissive. To have a good and healthy PHP code base so it won’t resemble the unmanageable cabling mess in the picture above, your project needs to have the following: no spaghetti codecode reuse (avoid code repetition)avoid complicated nested loopsEncapsulation (organize code in classes)Clean user I/OCode DocumentationConsistent code conventionsTests Luckily there are some PHP code quality tools that can help us address most of these problems and give us a diagnostic of our project’s code health. Documenting your code PHP Documentor: Documenting code with PHP Documentor is very simple and easy. Code consistency PHP Code Sniffer: A tool that analyses the syntax of your project’s code based on a PHP syntax standard. Testing Unit testing About the author

TDD Changed My Life – JavaScript Scene It’s 7:15 am and customer support is swamped. We just got featured on Good Morning America, and a whole bunch of first time customers are bumping into bugs. It’s all-hands-on-deck. Our ops superhero fires up his deploy scripts, and minutes later, the change is live. Why TDD? It’s been a while since I’ve had to deal with that situation. Whenever somebody asks me why they should bother with TDD, I’m reminded of this story — and dozens more like it. TDD eradicates fear of change. On my projects, our suites of automated unit and functional tests prevent disastrous breaking changes from happening on a near-daily basis. All of those upgrades integrated automatically, and they’re already live in production. What is TDD? TDD stands for Test Driven Development. Before you write implementation code, write some code that proves that the implementation works or fails. How TDD Can Save You Development Time Several years ago I was building a video clip range feature in a UI. But it wasn’t working.

Related: