Skip to content

Instantly share code, notes, and snippets.

View aikar's full-sized avatar
:atom:
Powered by Steak

Daniel Ennis aikar

:atom:
Powered by Steak
View GitHub Profile
<?php
class GEO
{
const
PI = M_PI,
TWOPI = 6.28318530718,
DE2RA = 0.01745329252,
RA2DE = 57.2957795129,
ERAD = 6378.135,
<?php
$db = new PDO('sqlite:ai.db');
$db->exec('
CREATE TABLE IF NOT EXISTS
phrases
(
`word` INTEGER,
`left` INTEGER,
`right` INTEGER,
PRIMARY KEY (`word`, `left`, `right`)
CREATE TABLE IF NOT EXISTS
words
(
`id` INTEGER PRIMARY KEY ASC,
`word` VARCHAR(45) NOT NULL
), INDEX `word` (`word`);
>>> sqlite3 ai.db
SQLite version 3.3.6
Enter ".help" for instructions
sqlite> select * from words limit 10;
1|figured
2|out
3|issue
4|hack
5|the
6|planet
<?php
class phpIBModule extends ModuleCore
{
private $db, $wordIdCache;
public function getWordId($word)
{
$db = $this->db;
$word = trim($word);
if(!$word) return 0;
<?php
function DB($query, $args = NULL, $return = false) {
$stmt = DB::prepare($query);
if ($args !== NULL && !is_array($args) && func_num_args() == 2) {
//support DB(query,return)
$return = $args;
$args = array();
}
if (!is_null($args) && is_array($args)) {
things im working with:
Mobile: media="handheld, handheld and (max-device-width: 480px), screen and (max-device-width: 480px)"
Non Mobile: media="only screen"
@aikar
aikar / DB.php
Last active August 17, 2016 10:11
<?php
function DB($query, $args = NULL, $return = false) {
$stmt = DB::prepare($query);
if ($args !== NULL && !is_array($args) && func_num_args() == 2) {
//support DB(query,return)
$return = $args;
$args = array();
}
if (!is_null($args) && is_array($args)) {
Date: 2010-10-12 23:40:22
ID: 55
Error occured in: Global
Count: 1
Message: ..\FrameXML\UIDropDownMenu.lua line 558:
attempt to index local 'frame' (a nil value)
Debug:
[C]: ?
..\FrameXML\UIDropDownMenu.lua:558: UIDropDownMenu_SetSelectedValue()
Auctionator\AuctionatorShop.lua:568: func()
#showtooltip Sinister Strike
/console Sound_EnableSFX 0
/startattack
/use Bladefist's Breadth
/castsequence reset=0/combat/target Sinister Strike,Feint
/console Sound_EnableSFX 1
/script UIErrorsFrame:Clear()