Skip to content

Instantly share code, notes, and snippets.

View viktorpetryk's full-sized avatar

Viktor Petryk viktorpetryk

  • Ukraine
  • 19:37 (UTC +02:00)
View GitHub Profile
@yohangdev
yohangdev / Dockerfile
Created May 7, 2021 16:54
Dockerfile PHP 8 & Newrelic Agent
FROM alpine:3.13
LABEL Maintainer="Yoga Hanggara <yohang88@gmail.com>" \
Description="Lightweight Laravel app container with Nginx 1.18 & PHP-FPM 8 based on Alpine Linux."
ARG PHP_VERSION="8.0.2-r0"
# Install packages
RUN apk --no-cache add php8=${PHP_VERSION} php8-fpm php8-opcache php8-openssl php8-curl php8-phar php8-session \
php8-fileinfo php8-pdo php8-pdo_mysql php8-mysqli php8-mbstring php8-dom \
@Vinai
Vinai / or-example.php
Last active September 28, 2021 20:48
SearchCriteria OR Example for Magento 2
<?php
declare(strict_types = 1);
namespace Training5\VendorRepository\Controller\Test;
use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Framework\Api\Filter;
use Magento\Framework\Api\FilterBuilder;
@subfuzion
subfuzion / global-gitignore.md
Last active September 17, 2026 14:15
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class