Thursday, November 21

PHP

Case Study: Optimizing CommonMark Markdown Parser with Blackfire.io
PHP

Case Study: Optimizing CommonMark Markdown Parser with Blackfire.io

As you may know, I am the author and maintainer of the PHP League's CommonMark Markdown parser. This project has three primary goals: fully support the entire CommonMark spec match the behavior of the JS reference implementation be well-written and super-extensible so that others can add their own functionality. This last goal is perhaps the most challenging, especially from a performance perspective. Other popular Markdown parsers are built using single classes with massive regex functions. As you can see from this benchmark, it makes them lightning fast: Library Avg. Parse Time File/Class Count Parsedown 1.6.0 2 ms 1 PHP Markdown 1.5.0 4 ms 4 PHP Markdown Extra 1.5.0 7 ms 6 CommonMark 0.12.0 46 ms 117 Unfortunately, because of the tightly-coupled design and overall architecture, it's dif...
PHP

How to Optimize Docker-based CI Runners with Shared Package Caches

At Unleashed Technologies we use Gitlab CI with Docker runners for our continuous integration testing. We've put significant effort into speeding up the build execution speeds. One of the optimizations we made was to share a cache volume across all the CI jobs, allowing them to share files like package download caches. Source: Sitepoint
PHP vs Python in 2018?
PHP

PHP vs Python in 2018?

One question I get often, is which programming language should you learn? … I’ve been getting this question for years! Things change in the programming world, languages come and go. But the good news is that the basics, the core concepts and techniques, are 90-95% the same in all the modern programming languages: JavaScript Python Java for web apps or Java for Andriod PHP C# Swift C++ C …. What that means, is that your programming language choice, isn’t nearly as critical as you’d think. Why? Well, once you know one programming language, it is easy as apple pie to switch to another! How to choose between PHP and Python? The key to choosing a language comes down to two things: market viability of the programming language and what KIND of programming you want to do....
How to Optimize SQL Queries for Faster Sites
PHP

How to Optimize SQL Queries for Faster Sites

You know that a fast site == happier users, improved ranking from Google, and increased conversions. Maybe you even think your WordPress site is as fast as it can be: you've looked at site performance, from the best practices of setting up a server, to troubleshooting slow code, and offloading your images to a CDN, but is that everything? With dynamic, database-driven websites like WordPress, you might still have one problem on your hands: database queries slowing down your site. In this post, I’ll take you through how to identify the queries causing bottlenecks, how to understand the problems with them, along with quick fixes and other approaches to speed things up. I’ll be using an actual query we recently tackled that was slowing things down on the customer portal of deliciousbrains.c...
PHP

How to Read Big Files with PHP (Without Killing Your Server)

It’s not often that we, as PHP developers, need to worry about memory management. The PHP engine does a stellar job of cleaning up after us, and the web server model of short-lived execution contexts means even the sloppiest code has no long-lasting effects. There are rare times when we may need to step outside of this comfortable boundary --- like when we're trying to run Composer for a large project on the smallest VPS we can create, or when we need to read large files on an equally small server. It’s the latter problem we'll look at in this tutorial. The code for this tutorial can be found on GitHub. Measuring Success The only way to be sure we’re making any improvement to our code is to measure a bad situation and then compare that measurement to another after we’ve applied our fi...
PHP

Your First PHP Code

The following is a short extract from our new book, PHP & MySQL: Novice to Ninja, 6th Edition, written by Tom Butler and Kevin Yank. It's the ultimate beginner's guide to PHP. SitePoint Premium members get access with their membership, or you can buy a copy in stores worldwide. Now that you have your virtual server up and running, it’s time to write your first PHP script. PHP is a server-side language. This concept may be a little difficult to grasp, especially if you’ve only ever designed websites using client-side languages like HTML, CSS, and JavaScript. A server-side language is similar to JavaScript in that it allows you to embed little programs (scripts) into the HTML code of a web page. When executed, these programs give you greater control over what appears in the browser win...
PHP

What is PHP 7?

PHP 7 - a revolution in the field of web development. This is the most important change for PHP since the release of PHP 5 in 2004, bringing explosive performance improvements, drastically reduced memory consumption, and a host of brand-new language features to make your apps soar. You also be wondering why PHP named its latest release PHP 7 and not PHP 6. Reason behind it is that, many of the PHP 6 releases were already implemented in PHP 5.3 and later, there was not really a proper reason just to change the name. What I am trying to say here is that we haven’t missed anything. Just to avoid the confusion with a dead project, PHP's latest release was named to PHP 7.
PHP

What does phpinfo () do?

phpinfo () is used to check configuration settings and for available predefined variables on a given system. phpinfo () is also a valuable debugging tool as it contains all EGPCS (Environment, GET, POST, Cookie, Server)
PHP

What is the PHP?

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.
Learning PHP more Easily by Learning Python … what!?
PHP

Learning PHP more Easily by Learning Python … what!?

PHP is probably the best web app development language out there today for a bunch of reason technical, and market oriented. But it’s not the only language out there and it doesn’t have a monopoly of good programming. Comparing Programming Languages An important lessons that my 20+ years of programming experience has taught me, is that one of the best ways to learn one programming language, is to learn another! By learning different programming languages, you will start to gain deeper insights about your first programming language. Here is the key point, most modern programming languages share about 98% of the same principles and language constructs. That said, each language has their own subtle take on how they do things. So for example, PHP creates functions with this code: function...
Python 3 Course of College and University
PHP

Python 3 Course of College and University

I am excited to announce our upcoming Python course: Powerful Python 3. A beginners course covering Python 3, students go from an absolute neophyte, to having a working knowledge of object oriented Python.  Course is based on Python 3.6. StudioWeb course details: In addition to a set of comprehensive and engaging videos, Power Python 3 will include quizzing, code challenges, and gamification that is provided by the StudioWeb app. Your students will learn Python easily, and they will have fun too! Each video lesson is supported by 4-5 quiz questions, that are made up of both code challenges and multiple choice questions. All our courses leverage the recursive spiral teaching method that helps us to achieve great outcomes with students. Professor’s Dream: From a professor’s perspecti...
Open Ended Lesson Plans and Teaching Code
PHP

Open Ended Lesson Plans and Teaching Code

After nearly 7 years of working with schools, it seems clear to me that the best way to teach code, is with an open ended lesson plan. Here’s why: Learners will learn at different speeds Different schools have different schedules Rigid lesson plans will inventively break Overly rigid lesson plans can easily be derailed … I hear about it all the time. Once that happens, teachers are scrambling to get things back on track. The other approach is to use a flexible lesson plan that allows for variability in the classroom: Student misses a few days. Student is talented and moving fast Student is struggling and needs more time School gets cancelled a few days for whatever reasons … A curriculum designed for reality Instead of a set of highly structured lesson plans that can b...
PHP Courses for College in 2017 and 2018
PHP

PHP Courses for College in 2017 and 2018

One of the reasons PHP is a good language to teach server side programming with, is because it is relatively easy to setup a PHP environment on each student’s workstation. With free apps like MAMP and WAMP, you can install a fully functional PHP installation with MySQL, Apache and it comes with an easy to use control panel to manage the servers. With this 1-click install running, students will be able to explore concepts like: web servers database servers http directory and how it impact server side code processing … And more. StudioWeb’s interactive PHP courses teach not only the fundamentals of programming, we also have included key project based courses (crud with PHP, PHP tag cloud) that allow students to see PHP used in a real-world programming context. Teachers benefit f...
PHP

GET BETTER ROI ON YOUR WEBSITE TODAY

Every entrepreneur and business owner is familiar with the term ROI. However, when it comes to their business websites they have little or nothing to say when talking about ROI. The overwhelming amount of information in the digital world can trick even the sharpest mind. There seems to be one to many online marketing strategies out there and it can be hard to choose what really works and how to take advantage of it. The pace with which technology advances is incredible and in the last decades, it has gone insane. There is digital innovation everywhere and there is so much of it that we can barely keep up with what is changing within our houses. No one seems to watch TV or play board games anymore. All we hear about in the living room is Netflix, Xbox, and countless different names of apps...
PHP is Server Side Programming’s Rocky!
PHP

PHP is Server Side Programming’s Rocky!

I’ve been writing code since 1994, and have used many programming languages over the years to build commercial apps. Thought PHP was NOT my favorite language, years ago, I came to respect the pragmatic and effective nature of the PHP universe. From day one, with PHP, you just got things done fast. PHP sucks! PHP is old! Funny, PHP is the programming world’s whipping boy. People have been disparaging the language for years and years. And yet, like Rocky Balboa, it just keeps on coming and winning! PHP now powers more websites than any other server side programming language … some estimates say nearly 80%! Consider that the 3 most popular CMS’ are built with PHP (WordPress, Drupal and Joomla) … it stands to reason. Contrast that to the once darling of the nerd-hipster programming wor...