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
checkSingleItem(new Dictionary<string, int>(){ | |
{"Strength", 120}, | |
{"All Resist", 50}, | |
{"Critical Hit", 6}, | |
{"Critical Damage", 30} | |
}, 1200000) | |
checkSingleItem(new Dictionary<string, int>(){ | |
{"Attack Speed", 5}, | |
{"Critical Hit", 3}, |
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
new Searchable("Armor", "Ring", 60, 60, 27000000, new List<Stat>() | |
{ | |
new Stat("Dexterity", randomRounded(90,100,5)), | |
new Stat("Critical Hit", randomRounded(3,3,1)), | |
new Stat("Critical Damage", randomRounded(25,25,1)) | |
}); | |
new Searchable("Armor", "Gloves", 60, 60, 10000000, new List<Stat>() | |
{ | |
new Stat("Attack Speed", randomRounded(6,7,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 | |
function reverseText($text){ | |
$arr = explode(" ", $text); | |
$result = ""; | |
while($temp = array_pop($arr)) | |
$result .= $temp . " "; | |
return $result; | |
} | |
$text = "The cat in the hat"; |
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 Node{ | |
public $id, $next; | |
public function __construct($id,$next){ | |
$this->id = $id; | |
$this->next = $next; | |
} | |
} |
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 | |
$app = new Slim(); | |
//routes here | |
$app->get('/', 'home'); | |
$app->get('/hi/:first(/)', 'hi'); | |
$app->get('/test(/)', 'test'); | |
$app->run(); | |
//controllers here! |
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 | |
//inside helpers/Settings.php class | |
public function db() { | |
if ($this->db == null) { | |
$server = "localhost"; | |
$user = "root"; | |
$pass = ""; | |
$dbName = "test"; | |
$this->db = new mysqli($server, $user, $pass, $dbName); | |
} |
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 Settings { | |
private $data = array(); | |
private $db = null; | |
public function __construct(){ | |
$this->siteRoot = str_replace("index.php", "", $_SERVER['PHP_SELF']); | |
$this->documentRoot = str_replace("index.php", "", $_SERVER['SCRIPT_FILENAME']); |
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 | |
//setup inside index.php | |
$config = new Settings(); | |
$config->scripts = array("jquery-1.7.1.min.js", "script.js"); | |
$config->styles = array("styles.css"); | |
//inside helpers/Settings.php class | |
public function __construct(){ | |
$this->siteRoot = str_replace("index.php", "", $_SERVER['PHP_SELF']); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title></title> | |
<style> | |
.lineNumber { | |
text-align: right; | |
font-size: 14px; | |
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace; |
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 | |
$pageName = $_GET['page']; | |
switch ($pageName) { | |
case "javascript": | |
$images = array("img1.png","img2.png","img3.png"); | |
$heading = "Javascript"; | |
$copy = "This is my javascript work"; | |
break; |