Skip to content

Instantly share code, notes, and snippets.

View gistrec's full-sized avatar
🦄
Программирую единорогов

Aleksandr Kovalko gistrec

🦄
Программирую единорогов
View GitHub Profile
<?php
function gamertag_exists($gamertag)
{
$first_step = explode("<div id=\"Gamerscore\">", file_get_contents("https://gamercard.xbox.com/en-US/$gamertag.card"));
$second_step = explode("</div>", $first_step[1]);
$gamerscore = $second_step[0];
if ($gamerscore != "--") {
return true;
} else {
return false;
@AntoscencoVladimir
AntoscencoVladimir / ubuntu-php7.2-zts-pthreads
Created February 24, 2018 17:02 — forked from 0xfff/ubuntu-php7.2-zts-pthreads
Installing php-zts on ubuntu 16.04
#####################################################################################
# INSTALL isolated PHP 7.2 ZTS (Thread-safe) with pthreads on Ubuntu 14.04 &16.04 ###
#####################################################################################
0) Possible dependencies
sudo apt-get install libxml2-dev
1) Install necessary bison version
wget http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb
@dktapps
dktapps / enable_strict_types.php
Created June 7, 2017 13:38
Hacked-together script to enable strict types in PHP files en masse. Primarily intended for PocketMine-MP.
<?php
declare(strict_types=1);
$startTime = microtime(true);
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR));
foreach($iterator as $file){
if($file->getExtension() === "php"){
$path = $file->getPath() . DIRECTORY_SEPARATOR . $file->getFilename();
@otanistudio
otanistudio / tabs-pre-commit
Created April 1, 2014 00:43
git pre-commit hook for checking tabs, but only in certain files. Just as an example, this one only looks for Obj-C, Obj-C++, C++, JSON and header files
if
git diff --cached --name-only | egrep '(\.(mm|m|h|cpp|json)$)' | xargs git diff --cached | egrep '^\+.*'$'\t' > /dev/null
then
echo "Tabs found in your commit. Please use (four) spaces and re-commit."
exit 1
fi
@kostaz
kostaz / Compile_Bitcoin_on_Ubuntu_14_04
Last active September 3, 2023 10:31
Compile Bitcoin on Ubuntu 14.04
Assuming the username of the Ubuntu user is "theusername".
Preparation
-----------
```
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@reagent
reagent / .gitignore
Last active November 8, 2023 08:53
Curses Windowing Example
demo
*.swp
{
"body": {
"input": {
"message": "Hello World"
},
"origin": {
"type": "player"
},
"name": "say",
"version": 1,
@jocopa3
jocopa3 / MCPE_1.1.0.1_Ids.txt
Last active December 20, 2023 07:15
List of all Blocks/Items/Entity Id's in MCPE/Win10 1.1.0.1 and EDU Edition
For advanced users, a syntax highlighter for sublime text and
textmate which makes reading the list easier can be found here:
https://gist.github.com/jocopa3/e4a35921e4f978572e7f45360d231f37
============ Blocks ============
All blocks as found in the 1.1.0.0 Block::initBlocks function.
Block names are the same names used in the /give command.
Name Id Data
@ninedraft
ninedraft / README.md
Last active January 29, 2024 23:27
Python udp broadcast client server example.

Python udp broadcast client-server example

⚠️ ❗ ATTENTION ❗ ⚠️

This gist is deprecated and will not be edited in the future. Consider visit ninedraft/python-udp repo. It will not be deleted, however.

⚠️ ❗ ATTENTION ❗ ⚠️