Skip to content

Instantly share code, notes, and snippets.

View brussens's full-sized avatar

Dmitry Brusensky brussens

View GitHub Profile
@Winfidonarleyan
Winfidonarleyan / ObjectMgr.cpp
Created July 30, 2018 11:30
Full localisation on load trinity string
bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max_value)
{
uint32 oldMSTime = getMSTime();
int32 start_value = min_value;
int32 end_value = max_value;
// some string can have negative indexes range
if (start_value < 0)
{
if (end_value >= start_value)
@naholyr
naholyr / compare.php
Created February 22, 2012 16:27
Extract namespace from a PHP file
<?php
// Works in every situations
function by_token ($src) {
$tokens = token_get_all($src);
$count = count($tokens);
$i = 0;
$namespace = '';
$namespace_ok = false;
while ($i < $count) {