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
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
Tomasz-Silpion / cleanup.sh
Created Nov 19, 2016
Basic bash script to git stash every server directory
View cleanup.sh
for d in */ ; do
(cd $d && git stash)
done
@Tomasz-Silpion
Tomasz-Silpion / validation.js
Created Aug 20, 2016
Prototype.js Magento value trim (replace spaces) on email validation
View validation.js
$$('.validate-email').each(function(input){
input.observe('change', function(e){
this.value = this.value.replace(/^\s+|\s+$/g,"");
});
});
@Tomasz-Silpion
Tomasz-Silpion / providers.php
Last active Aug 10, 2016
Count customers email domain occurences from Magento orders
View providers.php
<?php
require_once('app/Mage.php');
umask(0);
Mage::app();
$emails = array();
$orders = Mage::getModel('sales/order')->getCollection();
foreach ($orders as $order) {
$emails[] = $order->getCustomerEmail();
@Tomasz-Silpion
Tomasz-Silpion / payments.sql
Created Jul 20, 2016
Get all customers payment methods between range of dates from Magento database
View payments.sql
SELECT
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')
You can’t perform that action at this time.