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
create table general { | |
id INTEGER UNIQUE PRIMARY KEY, | |
userhash BLOB UNIQUE, | |
userid INTEGER, | |
ship TEXT, | |
time INT, | |
version TEXT, | |
fate TEXT, | |
player TEXT, | |
score INT, |
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 | |
function curl_get_contents($url, $timeout = 30, $settings_array = array()) | |
{ | |
$return false; | |
if (function_exists("curl_init")) { | |
$curl_options = array( | |
CURLOPT_URL => $url, | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_TIMEOUT => intval($timeout), | |
CURLOPT_HEADER => 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 | |
static function getCache($p_mOptions = null) { | |
if (!is_array($p_mOptions)) { | |
$config = self::getConfig(); | |
$options = isset($config->cache) ? $config->cache->toArray() : array(); | |
if (is_string($p_mOptions) && $p_mOptions !== '') { | |
$options['handler'] = $p_mOptions; | |
} | |
$p_mOptions = $options; | |
} |
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 | |
static function getCache($p_mOptions = null) | |
{ | |
if (!is_array($p_mOptions)) { | |
$config = self::getConfig(); | |
$options = isset($config->cache) ? $config->cache->toArray() : array(); | |
if (is_string($p_mOptions)) { | |
$options['handler'] = $p_mOptions; | |
} | |
$p_mOptions = $options; |
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 | |
static function getCache($p_mOptions = null) { | |
switch(true) { | |
case is_array($p_mOptions): | |
$options = $p_mOptions; | |
break; | |
case is_string($p_mOptions): |
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 | |
function find_person($array, $key, $search_term) | |
{ | |
// We are given 1 element | |
if (isset($array['name']) { | |
return find_person_helper($array, $key, $search_term); | |
} |
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 | |
function find_person($value, $key, $search_term) | |
{ | |
if($value == $search_term){ | |
print "Found $search_term in $key\n"; | |
return $the_person_id_in_the_same_array_as_this_term; | |
} | |
} |