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 Closable_PDO | |
{ | |
private $pdo; | |
public function __construct($dsn, $username, $password, $options) { | |
$this->pdo = new PDO($dsn, $username, $password, $options); | |
} | |
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 | |
public function insert_booking_date_match(Array $dates, $rule_id) | |
{ | |
$sql = "-- insert_booking_date_match | |
BEGIN; | |
DELETE FROM | |
rule_booking_date_match | |
WHERE | |
rule_id = ".$rule_id." |
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 | |
/** | |
* This Interface allows to hook into the global Xsort() functions. | |
* @ingroup SPL | |
* @since PHP 7.0 | |
*/ | |
interface Sortable | |
{ | |
/** |
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 | |
$source = 'echo "Hello World!\\n";'; | |
$gz = addslashes(gzdeflate($source,9)); | |
$a = "<?php \$var='"; $b = "'; eval(gzinflate(stripslashes(\$var)));"; | |
$result = $a.$gz.$b; | |
$fp = fopen('so-26316521-out.php', 'wb'); | |
fwrite($fp, $result); |
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
/* | |
table activities | |
activity_id int (auto-increment) primary key | |
name varchar | |
description varchar | |
table cabins | |
cabin_id int (auto-increment) primary key | |
name varchar |
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 memdiff() { | |
static $int = null; | |
$current = memory_get_usage(); | |
if ($int === null) { | |
$int = $current; | |
} else { | |
print ($current - $int) . "\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
/*! | |
* jQuery TextChange Plugin | |
* http://www.zurb.com/playground/jquery-text-change-custom-event | |
* | |
* Copyright 2010, ZURB | |
* Released under the MIT License | |
*/ | |
(function ($) { | |
$.event.special.textchange = { |
NewerOlder