Skip to content

Instantly share code, notes, and snippets.

@Eczbek
Eczbek / as.hpp
Last active July 15, 2026 14:34
as
struct as{template<class T>operator T(){throw;};template<class T>struct x{T x;template<class U>constexpr decltype(static_cast<U>((T)x))operator->*(U(as::*)())noexcept(noexcept(static_cast<U>((T)x))){return static_cast<U>((T)x);}};template<class T>friend constexpr x<T&&>operator->*(T&&x,as)noexcept{return{(T&&)x};}};
#define as ->*::as()->*&::as::operator
@Jengas
Jengas / index.php
Last active May 4, 2026 12:07
Discord oauth2 example PHP
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('max_execution_time', 300); //300 seconds = 5 minutes. In case if your CURL is slow and is loading too much (Can be IPv6 problem)
error_reporting(E_ALL);
define('OAUTH2_CLIENT_ID', '1234567890');
define('OAUTH2_CLIENT_SECRET', 'verysecretclientcode');