Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Maximize Your Terminal Productivity
Aug 29, 2017 @ 19:01:53

On the Laravel News site they've posted a guide to help you maximize your terminal productivity by sharing a few tips to help you get the most of out the time you spend at the command line.

This week, we just published some great bash aliases from the community, and I wanted to write more about maximizing your terminal productivity. I’ve coached many developers, and the terminal is often the area I see that many great developers (much better than me) could improve and gain some productivity and better tooling.

After talking about his own first steps as a developer and the tools he used, Paul Redmond talks about the set of helpful tools and software he now uses including:

  • the Zsh shell (and Oh My Zsh)
  • updating the CD Path
  • Using path expansion
  • History completion
  • History search and execution
  • Terminal themes

He ends the post with a few other recommendations of resources to check out and quick tips on sharing the results.

tagged: terminal productivity tips zsh plugin example

Link: https://laravel-news.com/maximize-terminal-productivity

Chris Hartjes' Blog:
How the Testing Sausage Gets Made
May 17, 2012 @ 14:19:33

For those either just getting into unit testing your applications (maybe even TDD) or those that are old hat at it and what to figure out a few more tricks of the trade, you should check out this latest post from Chris Hartjes about some of the tools he uses to get the job done.

So how does the Grumpy Programmer write code, TDD style? It starts with using a set of tools that reduce the amount of friction required. First, I do almost all my work from a terminal. [...] Why the terminal? PHPUnit is a CLI application. Yes, many popular editors and IDE's can do things like execute PHPUnit for you, but they are limited in what flexibility they provide.

He also talks about his editor of choice, vim, and some of the plugins he uses in his day to day testing development. This includes tools to handle things like interfacing with git/gists, working with ctags to see the code's structure, working with "surroundings" and the pathogen plugin to make adding other plugins easier. He keeps the code up in one terminal and his testing tool (PHPUnit or other) accessible in a second, making it a simple matter of switching to write the test then the functionality to make it pass.

If there is a lesson to be learned from this, it's to make sure that every tool that you use reduces the friction that is generated when building your application using TDD.
tagged: testing tools vim plugins tdd unittest phpunit terminal

Link:

Brian Moon's Blog:
Check for a TTY or interactive terminal in PHP
Sep 02, 2011 @ 14:12:47

In a new post to his blog Brian Moon describes a need he had for detecting if the client or user calling a PHP script was using an interactive terminal (TTY) or not:

Let's say I am trying to find out why some file import did not happen. Running the job that is supposed to do it may yield an error. Maybe it was a file permission issue or something. There are other people watching the alerts. What they don't know is that I am running the code and looking at these errors in real time.

Since the errors were being sent to the log file, they were lost to the client/user on the other end left staring at their script wondering what went wrong. He ended up with a solution (a pretty simple one too) that uses posix_ttyname and posix_isatty. He includes the little snippet of code he puts in his prepend file that checks for errors then checks for a TTY. If both are there, it turns off logging the errors to the file and sends them direct instead.

tagged: check tty interactive terminal posixisatty posixttyname error log

Link:

Rob Morgan's Blog:
Howto Log Directly to Your OS X Terminal using Zend Framework and NodeJS
Feb 19, 2010 @ 17:14:02

In an interesting post to his blog Rob Morgan shows how you can log in to a terminal from a Zend Framework application (on OS X) with the help of NodeJS.

NodeJS is a tool designed to provide an easy way to build scalable network programs. By using the I/O capabilities of NodeJS, I have built a simple TCP server that writes log messages to the OS X terminal (via STDOUT).

He shows how to take his example script and run NodeJS as a server on a local port (like 8003). You can then use his log writer plugin in your Zend Framework app to write directly to the waiting NodeJS server.

tagged: zendframework nodejs terminal osx tutorial

Link:

PHP-GTK Community Site:
Three Widgets and a Timer Class
May 31, 2007 @ 15:26:00

The PHP-GTK website has four new posts highlighting three different widgets and a Timer class to make working with delays in applications simpler:

Keep an eye on the Code Snippets section of the PHP-GTK website for more helpful tips and tricks.

tagged: timer codesnippet widget terminal dial scrolling label timer codesnippet widget terminal dial scrolling label

Link:

PHP-GTK Community Site:
Three Widgets and a Timer Class
May 31, 2007 @ 15:26:00

The PHP-GTK website has four new posts highlighting three different widgets and a Timer class to make working with delays in applications simpler:

Keep an eye on the Code Snippets section of the PHP-GTK website for more helpful tips and tricks.

tagged: timer codesnippet widget terminal dial scrolling label timer codesnippet widget terminal dial scrolling label

Link:


Trending Topics: