This file contains hidden or 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 | |
| /** | |
| * spellcheck.php | |
| * | |
| * @version 0.1 | |
| * @author Emil Hernvall <[email protected]> | |
| * @license Public Domain | |
| */ | |
| /** |
This file contains hidden or 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 | |
| # http://darklaunch.com/2009/08/07/base58-encode-and-decode-using-php-with-example-base58-encode-base58-decode | |
| ################################################################# | |
| function base58_encode($num) { | |
| $alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; | |
| $base_count = strlen($alphabet); | |
| $encoded = ''; |
This file contains hidden or 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 | |
| /** | |
| * Simple SocketServer that runs over the udp protocol. The run method takes a callable | |
| * which is called with the data received. | |
| * | |
| * @package Socket | |
| */ | |
| class SocketServer | |
| { |
This file contains hidden or 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
| #!/usr/bin/php | |
| <?php | |
| /** | |
| * Checks a list of domains and outputs any that use Google. | |
| * | |
| * usage: php ./googlecheck.php filewithdomains | |
| * | |
| */ | |
| stream_set_blocking(STDIN, 0); |
This file contains hidden or 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 | |
| /* | |
| * to-markdown - an HTML to Markdown converter for PHP | |
| * | |
| * Copyright 2013, Blake Turner | |
| * Licenced under the MIT licence | |
| * | |
| */ |
This file contains hidden or 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
| <pre> | |
| <?php | |
| ini_set('display_errors', 1); | |
| error_reporting(E_ALL); | |
| $host = '127.0.0.1'; | |
| $user = 'root'; | |
| $pass = ''; | |
| $db = 'test'; |
This file contains hidden or 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 | |
| # Need Composer with PHPUnit | |
| require 'vendor/autoload.php'; | |
| function cantor($x, $y) | |
| { | |
| // ((x + y) * (x + y + 1)) / 2 + y; | |
| return bcadd(bcdiv(bcmul(bcadd($x, $y), bcadd(bcadd($x, $y), 1)), 2), $y); | |
| } |
This file contains hidden or 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
| function super_json_decode($json, &$value, $assoc = false, $depth = 512, $options = 0) { | |
| $pValue = false; | |
| $result = json_decode($json, $assoc, $depth); | |
| if(json_last_error() == JSON_ERROR_NONE) { | |
| $pValue = $result; | |
| return true; | |
| } | |
| return false; | |
| } |
This file contains hidden or 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 | |
| /** | |
| * A simple class to read variable byte length binary data. | |
| * This is basically is a better replacement for unpack() function | |
| * which creates a very large associative array. | |
| * | |
| * @author Shubham Jain <[email protected]> | |
| * @example https://github.com/shubhamjain/PHP-ID3 | |
| * @license MIT License |
This file contains hidden or 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 GoogleTranslate { | |
| public $lastResult = ""; | |
| private $langFrom; | |
| private $langTo; | |
| private static $urlFormat = "http://translate.google.com/translate_a/t?client=t&text=%s&hl=en&sl=%s&tl=%s&ie=UTF-8&oe=UTF-8&multires=1&otf=1&pc=1&trs=1&ssel=3&tsel=6&sc=1"; | |
| public function __construct($from = "en", $to = "ka") { |