Skip to content

Instantly share code, notes, and snippets.

@timmyRS
timmyRS / shorter.php
Created June 21, 2017 06:13
An inperfect PHP script shorter for code golfing.
<?//noshort
/* This is a little script built for php on linux to short your PHP Scripts,
* it is not, it will never and it is not trying to be perfect,
* but it might still help you with your code golfes!
*******************************************************/
if(empty($argv[1]))
{
echo "Syntax: php shorten.php <file>\n";
@timmyRS
timmyRS / prepend.php
Last active January 22, 2023 02:45
The perfect PHP error handler.
<?php
// This changes the error handler to a more helping one.
// You must/can prepend this script - Help: http://stackoverflow.com/a/35298767/4796321
function h_error($severity, $message, $file, $line)
{
if (!(error_reporting() & $severity))
{
return;
}
@timmyRS
timmyRS / Renamer.php
Last active April 26, 2017 18:06
Rename files in a directory just the way you'd like to.
<?php
// Your configuration starts here.
// Testing. 'true' = Don't actually edit files and only output the name changes.
$testing = false;
// Folders. 'true' = Rename folders and files.
$folders = true;
// Recursive. 'true' = Also rename files in sub-directories.