Skip to content

Instantly share code, notes, and snippets.

View ranisalt's full-sized avatar
🦊

Ranieri Althoff ranisalt

🦊
View GitHub Profile
include('otinfo.php');
$server = new Otinfo('shadowcores.twifysoft.net'); // a porta é opcional: se omitida, o padrão é 7171
if ($server->execute()) {
echo 'Players online: ', $server->players['online'], '<br />',
'Server location: ', $server->serverinfo['location'], '<br />',
'Client version: ', $server->serverinfo['client'] , '<br />';
//apenas alguns exemplos de dados
} else {
echo 'Server offline';
//se execute() returnar false, o servidor esta offline
}
<?php
include('otinfo.php');
$server = new Otinfo('shadowcores.twifysoft.net');
if ($server->execute()) {
echo 'Players online: ', $server->players['online'], '<br />',
'Server location: ', $server->serverinfo['location'], '<br />',
'Client version: ', $server->serverinfo['client'] , '<br />';
} else {
echo 'Server offline';
}
private static $cache = 180; // tempo em segundos
<?php
if (!defined('IN_IPB')) {
print '<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.';
exit();
}
class Otinfo {
//class that works
}
@ranisalt
ranisalt / floyd.md
Last active May 11, 2016 02:53
Complexidade de Floyd modificado

Complexidade do algoritmo de Floyd modificado

FloydModificado()
início
	para i = 1 até n faça
		para j = 1 até n faça
			A[i,j] <- D[i,j];
			R[i,j] <- 0;
		fim para
@ranisalt
ranisalt / gnuplot.cpp
Created June 24, 2014 03:40
Arquivo que não foi
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include <sys/time.h>
#include "avl_tree.h"
#include "red_black_tree.h"
class logradouro {
function cleanPreviousIndentation(line)
return line:gsub("^%s+", ""):gsub("%s+$", "")
end
function escapeString(str)
return str:gsub("[()]", "%%%1")
end
function string:split(delimiter)
local array = {}
#!/usr/bin/env php
<?php
require 'simple_html_dom.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);