Skip to content

Instantly share code, notes, and snippets.

View Kris-Driv's full-sized avatar

Kristaps Drivnieks Kris-Driv

View GitHub Profile
Verifying myself as Primus#9110
@Kris-Driv
Kris-Driv / SampQuery.php
Last active June 28, 2017 20:18
SAMP Query API
<?php
// P.S. Kad man nav ko darit, es rakstu datoram instrukcijas.
// Čau Signe!
/**
* SAMP Query Script
*
* @author Chris-Prime
*/
<?php
namespace schematic;
use pocketmine\nbt\NBT;
use pocketmine\utils\Binary;
use pocketmine\block\Block;
use pocketmine\item\Item;
use pocketmine\Server;
class Schematic {
@Kris-Driv
Kris-Driv / PPYML2MySQL.php
Created March 19, 2017 14:05
Transfers PurePerms data saved in YAML format to MySQL database
<?php
/**
* @name zPPYML2MySQL
* @author Chris Prime
* @api 3.0.0
* @version 1.0.0
* @main ym\PPYML2MySQL
* @loadafter PurePerms
*/
<?php
// Prepare
if(!function_exists('yaml_emit')) die('yaml extension not loaded');
if(!isset($argv[1])) die("enter a valid path to file".PHP_EOL);
$source = $argv[1];
if(!file_exists($source)) die("file '$source' does not exist".PHP_EOL);
$to = substr($source, 0, strpos($source, '.ini')) . ".yml";
if(file_exists($to)) die("can't save file to '$to' file already exists".PHP_EOL);