Command Line trash
One of the first commands you learn when experimenting with command line is rm
, the utility for deleting files and directories. Deletion is a core computer UI operation but operating systems use a "Trash" paradigm, where files are stored before truly deleted. With the rm
utility, however, files are immediately, permanently deleted.
If you're like me and afraid to automate permanent file deletion, you can opt for a utility named trash
. This nice Node.js library moves files to the trash instead of instant deletion.
// Install with `yarn add trash`
// Move a file to trash
const trash = require('trash');
await trash('bug-report.jpg');
There's also a trash-cli
package for using the utility from command line:
yarn add trash-cli
# Usage
trash unicorn.png rainbow.png
trash '*.png' '!unicorn.png'
rm
can be really harsh so having a trash
utility is helpful in providing users a file deletion paradigm that they're used to.
![Responsive Images: The Ultimate Guide]()
Chances are that any Web designers using our Ghostlab browser testing app, which allows seamless testing across all devices simultaneously, will have worked with responsive design in some shape or form. And as today's websites and devices become ever more varied, a plethora of responsive images...
![5 HTML5 APIs You Didn’t Know Existed]()
When you say or read "HTML5", you half expect exotic dancers and unicorns to walk into the room to the tune of "I'm Sexy and I Know It." Can you blame us though? We watched the fundamental APIs stagnate for so long that a basic feature...
![Create Tiny URLs with TinyURL, MooTools, and PHP]()
Since we've already figured out how to create TinyURL URLs remotely using PHP, we may as well create a small AJAX-enabled tiny URL creator. Using MooTools to do so is almost too easy.
The XHTML (Form)
We need an input box where the user will enter...
![Use Custom Missing Image Graphics Using Dojo]()
A few months back I posted an article about how you can use your own "missing image" graphics when an image fails to load using MooTools and jQuery. Here's how to do the same using Dojo.
The HTML
We'll delegate the image to display by class...
Hej David, there is even a shell alternative if you prefer to stick to the tools you already have like me. Just write down this simple function