Skip to content

Instantly share code, notes, and snippets.

View deshack's full-sized avatar

Mattia Migliorini deshack

View GitHub Profile
@deshack
deshack / openfront-discord-bot-terms-of-service.md
Created January 31, 2026 08:53
OpenFront Discord Bot Terms of Service

Terms of Service for OpenFront Bot

Effective Date: January 31, 2026

By inviting OpenFront Bot ("the Bot") to your Discord server or using its features, you agree to the following terms:

  1. Usage: You agree to use the Bot in accordance with Discord's Terms of Service and Community Guidelines.
  2. Abuse: You may not use the Bot to spam, harass, or facilitate illegal activities.
  3. Availability: The Bot is provided "as is." While we aim for 100% uptime, we cannot guarantee the service will always be available or error-free.
  4. Premium Subscriptions & Refunds:
@deshack
deshack / openfront-discord-bot-privacy-policy.md
Last active January 31, 2026 08:45
OpenFront Discord Bot Privacy Policy

Privacy Policy for OpenFront Bot

Effective Date: January 31, 2026

1. Introduction

OpenFront Bot ("the Bot") is a Discord application developed by @deshack. We are committed to protecting your privacy. This policy details what information we collect, how we use it, and your rights regarding your data.

2. Information We Collect

To provide our services (OpenFront stats, win statistics, win announcements, clan leaderboard), we collect the following data:

@deshack
deshack / php7-return-type-declarations-interface.php
Created June 6, 2016 15:55
PHP7 Return Type Declarations with interfaces
<?php
class User {}
interface UserFactoryContract {
public static function generate() : User;
}
class UserFactory implements UserFactoryContract {
public static function generate() {
@deshack
deshack / php7-return-type-declarations-usage.php
Created June 6, 2016 15:47
PHP7 usage of return type declarations
<?php
class User {}
function getUserWrong() : User {
return [];
}
getUserWrong();
// PHP Warning: Uncaught TypeError: Return value of getUserWrong() must be an instance of User, array returned
@deshack
deshack / php7-dynamic-return-type.php
Created June 6, 2016 15:44
PHP7 dynamic return type
<?php
function maybeGetUser() {
return [];
}
var_dump(maybeGetUser());
// array(0) {
// }
@deshack
deshack / php5-return-types.php
Created June 6, 2016 15:41
PHP5 Return Types
<?php
function getUser() {
return array();
}
var_dump(getUser());
// array(0) {
// }
@deshack
deshack / php5-return-type.php
Created June 6, 2016 15:38
PHP7 Return Type Declarations
<?php
/**
* Return type in PHP5.
*
* @copyright 2016 SqueezyWeb
* @author Mattia Migliorini <mattia@squeezyweb.com>
*/
/**
* Get User instance.
@deshack
deshack / php7-type-hinting-strict.php
Created May 27, 2016 14:30
PHP7 Strict Type Hinting - see https://gist.github.com/deshack/e63358a8726b7c3e0ba13563e4f9864c for a full collection of examples about PHP5/PHP7 type hinting
<?php
// Force Type Hinting to do a strict type check (the same as ===).
declare(strict_types=1);
function setBool(bool $bool) {
var_dump($bool);
}
setBool('foo');
@deshack
deshack / php7-type-hinting-casting.php
Last active May 27, 2016 14:40
PHP7 Type Hinting with Casting - see https://gist.github.com/deshack/e63358a8726b7c3e0ba13563e4f9864c for a full collection of examples about PHP5/PHP7 type hinting
<?php
function setBool(bool $bool) {
var_dump($bool);
}
setBool(true); // bool(true)
setBool('foo'); // bool(true)
setBool(''); // bool(false)
@deshack
deshack / php7-type-hinting.php
Last active May 27, 2016 14:17
PHP7 Type Hinting - see https://gist.github.com/deshack/e63358a8726b7c3e0ba13563e4f9864c for a full collection of examples about PHP5/PHP7 type hinting
<?php
function setValue(string $value) {
var_dump($value);
}
setValue('foo');
// string(3) "foo"
setValue([]);