Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Tomasz Gregorczyk Tomasz-Silpion

I may be slow to respond.
Block or report user

Report or block Tomasz-Silpion

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Tomasz-Silpion / pca.js
Last active Mar 21, 2019 — forked from thomaslorentsen/pca.js
Custom integration of post code anywhere
View pca.js
pca.on("load", function (type, id, control) {
control.listen("populate", function (address) {
Tomasz-Silpion / hide_children_products.php
Created Feb 15, 2018
Hide Magento 1 products with configurable parents
View hide_children_products.php
require_once 'abstract.php';
class Hide_Children_Products extends Mage_Shell_Abstract {
* Hide products having at least one configurable parent
public function run()
Tomasz-Silpion / recipients.sql
Created Oct 30, 2017
Get Magento queue recipients who received outdated email
View recipients.sql
SELECT DISTINCT `recipient_email` FROM `core_email_queue` INNER JOIN `core_email_queue_recipients` ON `core_email_queue`.`message_id` = `core_email_queue_recipients`.`message_id` WHERE `processed_at` > '2017-10-30 00:00:00' AND `created_at` < '2017-10-25 00:00:00'
Tomasz-Silpion / config.php
Created Oct 24, 2017
Get element from multidimensional array by path in php
View config.php
* @author Silpion <>
class Config {
protected $config = [
'a' => [
Tomasz-Silpion / nocache.conf
Last active Jun 8, 2017
Nginx config to return Magento 1 not cached images if the cached version does not exist
View nocache.conf
location ^~ /media/catalog/product/cache/ {
try_files $uri @nocache;
location @nocache {
rewrite ^/(media/catalog/product)/(.*/.*/.*/.*)/(.*/.*/.*) /$1/$3 redirect;
Tomasz-Silpion /
Created Jun 5, 2017
Magento2 shell script shorthand for redeployment with Snowdog front-end tools gulp usage
# Magento2 shell script shorthand for redeployment
php bin/magento setup:upgrade
cd tools && gulp clean && cd ..
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
cd tools && gulp styles && cd ..
chmod -R 775 var
chmod -R 775 pub/static
Tomasz-Silpion / wcpdf.php
Created Apr 14, 2017
Load WooCommerce PDF Invoices & Packing Slips document anywhere
View wcpdf.php
$wpo_wcpdf = WPO_WCPDF();
$pdf = $wpo_wcpdf->export->get_pdf('invoice', array($order_id));
echo $pdf;
Tomasz-Silpion / fix_stock.php
Created Mar 10, 2017
Fix Woocommerce stock to match qty
View fix_stock.php
define('WP_USE_THEMES', false);
$args = array('post_type' => 'product', 'posts_per_page' => -1);
$loop = new WP_Query($args);
while ($loop->have_posts()) : $loop->the_post();
Tomasz-Silpion /
Created Feb 7, 2017
Script for parsing Google PageSpeed optimized content MANIFEST
# Script for parsing Google PageSpeed optimized content MANIFEST
# Copyright (C) 2016 Tomasz Silpion Gregorczyk - All Rights Reserved
while IFS= read line
#strip file paths
IFS=':' read -r src protocol url <<EOF
Tomasz-Silpion /
Created Jan 28, 2017
Shell script for database and files site backup
# Database credentials
# Database dump
mysqldump --user=$DB_USER --password=$DB_PASS --host=$DB_HOST $DB_NAME > $(date +"%d-%m-%Y").sql
# Files backup
You can’t perform that action at this time.