This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PGM{ | |
public | |
$magicNumber = '', | |
$pixelArray = array(), | |
$width = 0, | |
$height = 0, | |
$grayMax = 0, | |
$createdBy = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function encrypt_mcrypt($msg, $key, $iv = null) { | |
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); | |
if (!$iv) { | |
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); | |
} | |
$pad = $iv_size - (strlen($msg) % $iv_size); | |
$msg .= str_repeat(chr($pad), $pad); | |
$encryptedMessage = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $msg, MCRYPT_MODE_CBC, $iv); | |
return base64_encode($iv . $encryptedMessage); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* | |
* * Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* * Redistributions in binary form must reproduce the above copyright | |
* notice, this list of conditions and the following disclaimer in the | |
* documentation and/or other materials provided with the distribution. | |
* * Neither the name of the <organization> nor the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer