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
/** | |
* example C code using libcurl and json-c | |
* to post and return a payload using | |
* http://jsonplaceholder.typicode.com | |
* | |
* License: | |
* | |
* This code is licensed under MIT license | |
* https://opensource.org/licenses/MIT | |
* |
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 | |
/** | |
* Example with all methods and default keys: | |
* | |
* $crypt = new phpCrypt; | |
* | |
* $crypt->cipher = "blowfish"; | |
* printf("crypted == %s\ndecrypted == %s\n\n", ($crypted = $crypt->encrypt("hello world")), $crypt->decrypt($crypted)); | |
* | |
* $crypt->cipher = "xor"; |
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 | |
/* test host list */ | |
$hostlist = array( | |
'96.4.1.22', | |
'207.191.191.90', | |
'8.8.8.8' | |
); | |
/* do the lookup */ |
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 | |
/** | |
* CIDR.php | |
* | |
* Utility Functions for IPv4 ip addresses. | |
* Supports PHP 5.3+ (32 & 64 bit) | |
* @author Jonavon Wilcox <[email protected]> | |
* @revision Carlos Guimarães <[email protected]> | |
* @version Wed Mar 12 13:00:00 EDT 2014 | |
*/ |
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 | |
if (php_sapi_name() !== 'cli') { | |
die('This script may only be run from the command line.' . "\n"); | |
} | |
if ($argc < 2) { | |
die('Usage: ' . $argv[0] . ' <encryption key>' . "\n"); | |
} |
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 | |
/** | |
* Generate rfc compliant v3, v4 and v5 uuids | |
* @see http://www.php.net/manual/en/function.uniqid.php#94959 | |
* @param int $type uuid version to generate (3, 4 or 5) | |
* @param string $namespace namespace for v3 and v5 uuids (default null) | |
* @param string $name name string for v3 and v5 uuids (default null) | |
* @return string|false generated uuid or false on failure | |
* @internal |
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 | |
/** | |
* Array to Text Table Generation Class | |
* | |
* @author Tony Landis <[email protected]> | |
* @link http://www.tonylandis.com/ | |
* @copyright Copyright (C) 2006-2009 Tony Landis | |
* @license http://www.opensource.org/licenses/bsd-license.php | |
*/ | |
class ArrayToTextTable |
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 | |
/* generate rfc compliant v3,v4 and v5 uuids | |
* http://www.php.net/manual/en/function.uniqid.php#94959 | |
* $type -> uuid version to generate (3, 4 or 5) | |
* $namespace -> namespace for v3 and v5 uuids | |
* $name -> string for v3 and v5 uuids | |
*/ | |
function generate_uuid($type, $namespace = null, $name = null) { | |
switch($type) { |
NewerOlder