Skip to content

Instantly share code, notes, and snippets.

View srsbiz's full-sized avatar

Radosław Kowalewski srsbiz

View GitHub Profile
@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)
{
@srsbiz
srsbiz / heidisql_pass.php
Created August 24, 2015 11:09
decode HeidiSQL password in php
<?php
// ported from http://sourceforge.net/p/heidisql/code/HEAD/tree/trunk/source/helpers.pas#l462
function heidisql_decrypt($str){
$j = $salt = $nr = 0;
$result = '';
if ($str == '') {
return ;
}
$j = 0;
$salt = intval($str[strlen($str)-1]);