Skip to content

Instantly share code, notes, and snippets.

@dustinlakin
dustinlakin / gist:3195277
Created July 28, 2012 23:36
Diablo 3 AH bot List
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},
@dustinlakin
dustinlakin / gist:3195267
Created July 28, 2012 23:33
Diablo 3 AH bot Search
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)),
@dustinlakin
dustinlakin / reverseText.php
Created April 17, 2012 16:05
Reverse Text
<?php
function reverseText($text){
$arr = explode(" ", $text);
$result = "";
while($temp = array_pop($arr))
$result .= $temp . " ";
return $result;
}
$text = "The cat in the hat";
@dustinlakin
dustinlakin / reverseList.php
Created April 17, 2012 16:03
Reverse List
<?php
class Node{
public $id, $next;
public function __construct($id,$next){
$this->id = $id;
$this->next = $next;
}
}
@dustinlakin
dustinlakin / RoutesAndControllers.php
Created April 5, 2012 09:08
Routes and Controllers
<?php
$app = new Slim();
//routes here
$app->get('/', 'home');
$app->get('/hi/:first(/)', 'hi');
$app->get('/test(/)', 'test');
$app->run();
//controllers here!
@dustinlakin
dustinlakin / databaseSettings.php
Created April 5, 2012 09:04
Settings Database
<?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);
}
@dustinlakin
dustinlakin / settingsConstructor.php
Created April 5, 2012 08:53
Settings Constructor
<?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']);
@dustinlakin
dustinlakin / settingsSetup.php
Created April 5, 2012 08:50
Setting up Settings
<?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']);
<!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;
@dustinlakin
dustinlakin / bryun.php
Created August 24, 2011 03:29
Quick Example of dynamic page
<?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;