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 / payments.sql
Created Jul 20, 2016
Get all customers payment methods between range of dates from Magento database
View payments.sql
o.grand_total AS 'Order Total',
o.created_at AS 'Payment Day',
p.method AS 'Payment Method',
CONCAT_WS(' ', o.customer_firstname, o.customer_lastname) AS 'Customer Name',
o.increment_id AS 'Order Number'
FROM sales_flat_order o
LEFT JOIN sales_flat_order_payment p ON p.entity_id = o.entity_id
WHERE (o.created_at BETWEEN '2016-01-01' AND '2016-12-31')
Tomasz-Silpion / providers.php
Last active Aug 10, 2016
Count customers email domain occurences from Magento orders
View providers.php
$emails = array();
$orders = Mage::getModel('sales/order')->getCollection();
foreach ($orders as $order) {
$emails[] = $order->getCustomerEmail();
Tomasz-Silpion / validation.js
Created Aug 20, 2016
Prototype.js Magento value trim (replace spaces) on email validation
View validation.js
input.observe('change', function(e){
this.value = this.value.replace(/^\s+|\s+$/g,"");
Tomasz-Silpion /
Created Nov 19, 2016
Basic bash script to git stash every server directory
for d in */ ; do
(cd $d && git stash)
Tomasz-Silpion / prolong_cookie.php
Created Dec 12, 2016
Prolong all cookies by 1 minute (extending all cookies lifetime)
View prolong_cookie.php
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
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 / 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 / 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 /
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
You can’t perform that action at this time.