Skip to content

Instantly share code, notes, and snippets.

Radosław Kowalewski srsbiz

Block or report user

Report or block srsbiz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@srsbiz
srsbiz / heidisql_pass.php
Created Aug 24, 2015
decode HeidiSQL password in php
View heidisql_pass.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]);
@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)
{
@srsbiz
srsbiz / hexit.php
Last active Dec 11, 2015
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 / pgm.p5.php
Last active Dec 12, 2015
Read and write PGM P5 images in php
View pgm.p5.php
<?php
class PGM{
public
$magicNumber = '',
$pixelArray = array(),
$width = 0,
$height = 0,
$grayMax = 0,
$createdBy = '';
View silex.AutoLoginServiceProvider.php
<?php
class AutoLoginServiceProvider implements \Silex\ServiceProviderInterface {
public function boot(\Silex\Application $app) {
if (!isset($app['security'])) {
throw new \LogicException('You must register the SecurityServiceProvider to use the AutoLoginServiceProvider');
}
}
View watki.c
#include <pthread.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
#include <signal.h>
#include <string.h>
pthread_t tid;
typedef struct data
View text_variations.php
<?php
/**
*
* @param string $txt Text to variate. All synonyms myst be placed in curly parenthesis, separated by pipe sign
* (ex. $txt = "I own {2|3} phones manufactured by {Apple|Samsung|HTC}.")
* @param boolean $shuffle Shuffle variations. If false,
* @return string[] All possible variations of $txt
*/
function create_text_variations($txt, $shuffle = true) {
@srsbiz
srsbiz / repo-rinse.sh
Created Jan 27, 2018 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
View repo-rinse.sh
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
View wrap-emoji.js
function wrapEmojis(txt) {
var regex = /(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c[\ude01\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c[\ude32\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|[\ud83c[\ude50\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g;
return txt.replace(regex, function(emoji){ return '<span class="emoji">' + emoji + '</span>' });
}
@srsbiz
srsbiz / README.md
Created Nov 20, 2018 — forked from BoGnY/README.md
[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively
View README.md

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
You can’t perform that action at this time.