Skip to content

Instantly share code, notes, and snippets.

View srsbiz's full-sized avatar

Radosław Kowalewski srsbiz

View GitHub Profile
@srsbiz
srsbiz / hexit.php
Last active December 1, 2022 04:59
Web hex dumper, with colors
<?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 December 11, 2015 01:49
Multibyte friendly tab to space replacer
<?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)
{