Skip to content

Instantly share code, notes, and snippets.

@R1KO
R1KO / fix.cpp
Created December 4, 2023 12:23
Fix
public void OnPluginEnd()
{
if(!CanTestFeatures() || GetFeatureStatus(FeatureType_Native, "VIP_UnregisterFeature") != FeatureStatus_Available)
{
return;
}
if(VIP_IsValidFeature(g_sFeatureWeapon[0]))
VIP_UnregisterFeature(g_sFeatureWeapon[0]);
@R1KO
R1KO / flattenExceptionBacktrace.php
Created March 24, 2021 15:06 — forked from Thinkscape/flattenExceptionBacktrace.php
Make any PHP Exception serializable by flattening complex values in backtrace.
<?php
function flattenExceptionBacktrace(\Exception $exception) {
$traceProperty = (new \ReflectionClass('Exception'))->getProperty('trace');
$traceProperty->setAccessible(true);
$flatten = function(&$value, $key) {
if ($value instanceof \Closure) {
$closureReflection = new \ReflectionFunction($value);
$value = sprintf(
'(Closure at %s:%s)',