Skip to content

Instantly share code, notes, and snippets.

View afilina's full-sized avatar

Anna Filina afilina

View GitHub Profile
@afilina
afilina / gist:fc1630a455ef98e1c9a2e8c30660c2ac
Created November 7, 2025 14:54
array_sum, array_product
/intervention/image/src/Colors/Cmyk/Color.php
return 0 === array_sum([
$this->cyan()->value(),
$this->magenta()->value(),
$this->yellow()->value(),
]);
/shardj/zf1-future/library/Zend/Barcode/Renderer/Pdf.php
array_sum($widths) / $font->getUnitsPerEm()
/twig/twig/src/Profiler/Profile.php
unserialize($data)
/shardj/zf1-future/library/Zend/Locale/Data.php
return unserialize($result);
/shardj/zf1-future/library/Zend/Locale/Data.php
return unserialize($result);
/shardj/zf1-future/library/Zend/Http/UserAgent/AbstractDevice.php
/wp-cli/wp-cli/php/WP_CLI/Runner.php
static function ( $dir ) {
static $wp_load_count = 0;
/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php
$contentHeaderLookup = isset($server['LAMINAS_DIACTOROS_STRICT_CONTENT_HEADER_LOOKUP'])
? static function (string $key): bool {
static $contentHeaders = [
/stichoza/google-translate-php/src/GoogleTranslate.php
#!/bin/bash
# Prometheus Exporters install script for RHEL/CentOS based environment
# Always the latest exporter versions will be installed!
DEFAULT_APACHE_PORT=9117
DEFAULT_NGINX_PORT=9113
DEFAULT_PHPFPM_PORT=9001
DEFAULT_SYSTEM_PORT=9100
check_selinux() {
@afilina
afilina / obfuscate.php
Created August 18, 2023 22:16
Obfuscate an account number
<?php
$accountNumber = '222222222234';
$revealLength = 4;
$obfuscationChar = '*';
$obfuscatedAccountNumber = str_pad(
substr($accountNumber, -$revealLength, $revealLength),
strlen($accountNumber),
$obfuscationChar,
https://twitter.com
@afilina
afilina / deserialization.yaml
Last active August 21, 2018 19:31
Insecure deserialization
id: 1
name: !php/object O:49:"Symfony\Component\Cache\Adapter\FilesystemAdapter":1:{s:54:"Symfony\Component\Cache\Adapter\FilesystemAdaptertmp";s:14:"../config.yaml";}
(icode
Product
p0
(dp1
S'name'
p2
S'Skyrim'
p3
sb.
DEFACED!
&lt;script&gt;alert(&#39;hacked!&#39;)&lt;/script&gt;