Skip to content

Instantly share code, notes, and snippets.

Avatar

Radosław Kowalewski srsbiz

View GitHub Profile
@srsbiz
srsbiz / hexit.php
Last active Feb 27, 2021
Web hex dumper, with colors
View hexit.php
<?php
header('Content-Type: text/html; charset=utf-8');
define('POST_MAX_LENGTH', 4096);
if (!isset($_POST['txt'])) {
$txt = "<?php\necho 'Hello World!';\n?>";
} elseif(strlen($_POST['txt']) > POST_MAX_LENGTH) {
$txt = substr($_POST['txt'], 0, POST_MAX_LENGTH);
} else {
$txt = $_POST['txt'];
@srsbiz
srsbiz / tab2space.php
Last active Dec 11, 2015
Multibyte friendly tab to space replacer
View tab2space.php
<?php
/**
* Multibyte friendly tab replacer.
* @param string $line Line with tabs to convert
* @param int $tabsize Number of space characters in full width tab
* @return string Line without tabs
*/
function tab2space($line, $tabsize = 4)
{