How to remove globally a package from Composer?

To remove a globally installed package run: composer global remove phpunit/phpunit global command lets you to run many commands like install, require or update as if you were running them from the COMPOSER_HOME directory. Read the related documentation here: http://getcomposer.org/doc/03-cli.md#global COMPOSER_HOME depends on your system (on Linux it’s ~/.composer), see http://getcomposer.org/doc/03-cli.md#composer-home for more details.

How can I beautify JavaScript code using Command Line?

First, pick your favorite Javascript based Pretty Print/Beautifier. I prefer the one at http://jsbeautifier.org/, because it’s what I found first. Downloads its file https://github.com/beautify-web/js-beautify/blob/master/js/lib/beautify.js Second, download and install The Mozilla group’s Java based Javascript engine, Rhino. “Install” is a little bit misleading; Download the zip file, extract everything, place js.jar in your Java classpath (or … Read more

Does PHP have threading?

From the PHP manual for the pthreads extension: pthreads is an Object Orientated API that allows user-land multi-threading in PHP. It includes all the tools you need to create multi-threaded applications targeted at the Web or the Console. PHP applications can create, read, write, execute and synchronize with Threads, Workers and Stackables. As unbelievable as … Read more

Add text at the end of each line

You could try using something like: sed -n ‘s/$/:80/’ ips.txt > new-ips.txt Provided that your file format is just as you have described in your question. The s/// substitution command matches (finds) the end of each line in your file (using the $ character) and then appends (replaces) the :80 to the end of each … Read more

Change working directory in my current shell context when running Node script

The correct way to change directories is actually with process.chdir(directory). Here’s an example from the documentation: console.log(‘Starting directory: ‘ + process.cwd()); try { process.chdir(‘/tmp’); console.log(‘New directory: ‘ + process.cwd()); } catch (err) { console.log(‘chdir: ‘ + err); } This is also testable in the Node.js REPL: [monitor@s2 ~]$ node > process.cwd() ‘/home/monitor’ > process.chdir(‘../’); undefined … Read more

Laravel 5 – Clear Cache in Shared Hosting Server

You can call an Artisan command outside the CLI. Route::get(‘/clear-cache’, function() { $exitCode = Artisan::call(‘cache:clear’); // return what you want }); You can check the official doc here http://laravel.com/docs/5.0/artisan#calling-commands-outside-of-cli Update There is no way to delete the view cache. Neither php artisan cache:cleardoes that. If you really want to clear the view cache, I think … Read more