Skip to content

Instantly share code, notes, and snippets.

View MakStashkevich's full-sized avatar
🍀
believe on the best

Maksim Stashkevich MakStashkevich

🍀
believe on the best
View GitHub Profile
@JevinJ
JevinJ / ThreadPool.py
Last active March 27, 2022 07:56
An Interruptible/Pausable thread pool in python, KeyboardInterrupt will stop the pool, KeyboardInterrupt can be caught to start the pool where it left off.
import queue
import threading
import os
import time
import signal
class Worker(threading.Thread):
def __init__(self, tasks, results):
super().__init__()
self.tasks = tasks
@xISRAPILx
xISRAPILx / Horse.php
Created September 2, 2018 19:43
Horse colors
<?
public const WHITE = 0;
public const WHITE_WHITE = 256;
public const WHITE_WHITE_FIELD = 512;
public const WHITE_WHITE_DOTS = 768;
public const WHITE_BLACK_DOTS = 1024;
public const CREAMY = 1;
public const CREAMY_WHITE = 257;
public const CREAMY_WHITE_FIELD = 513;
@xISRAPILx
xISRAPILx / Query.php
Last active April 23, 2022 11:35
Класс для получения информации с сервера SAMP.
<?php
/**
*
* ____ _ _ ____ ____ _ __ __ ____
* | _ \| | | | _ \ / ___| / \ | \/ | _ \
* | |_) | |_| | |_) | \___ \ / _ \ _____| |\/| | |_) |
* | __/| _ | __/ ___) / ___ \_____| | | | __/
* |_| |_| |_|_| |____/_/ \_\ |_| |_|_|
*
* This project is not affiliated with SA-MP team nor RakNet.
@JasonCrowe
JasonCrowe / dict_2_excel.py
Created August 12, 2018 14:20
Save varied dicts to excel
from xlsxwriter import Workbook
players = [
{'dailyWinners': 3, 'dailyFree': 2, 'user': 'Player1', 'bank': 0.06},
{'dailyWinners': 3, 'dailyFree': 2, 'user': 'Player2', 'bank': 4.0, 'level': 'Gold'},
{'dailyWinners': 1, 'dailyFree': 2, 'user': 'Player3', 'bank': 3.1},
{'dailyWinners': 3, 'dailyFree': 2, 'user': 'Player4', 'bank': 0.32, 'time': 'AM'}
]
def write_excel(dict_objects, filename, sheetname=None):
ordered_list = []
<?php
declare(strict_types=1);
class clazz{
public $var1 = "value1";
protected $var2 = "value2";
private $var3 = "value3";
}
<?php
declare(strict_types=1);
namespace converter;
use function intdiv;
use function min;
class TimeUtils{
@ijortengab
ijortengab / mysqldump.sh
Created February 7, 2018 05:20
Synchronize database MySQL - Gak Pake Lama
#!/bin/bash
# Filename: mysqldump.sh
# Author: IjorTengab (http://ijortengab.id)
# Last Update: 2018-02-07
#
# Variables. Set by your own value.
HOST=
USER=
PASSWORD=
DATABASE=
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@Encritary
Encritary / Trading.php
Created December 27, 2017 05:30
Trading example for Prismarine 1.2; to use this on pmmp you have to rewrite this a bit
<?php
namespace Encritary;
use pocketmine\entity\Entity;
use pocketmine\entity\Villager;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerInteractEvent;
use pocketmine\event\player\PlayerQuitEvent;
use pocketmine\event\server\DataPacketReceiveEvent;
@Encritary
Encritary / Trading.php
Created December 27, 2017 05:09
Trading example for GenisysPro or Prismarine server softwares
<?php
namespace Encritary;
use pocketmine\entity\Entity;
use pocketmine\entity\Villager;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerInteractEvent;
use pocketmine\event\player\PlayerQuitEvent;
use pocketmine\event\server\DataPacketReceiveEvent;