Skip to content

Instantly share code, notes, and snippets.

View mehdichaouch's full-sized avatar
🤖
Happiness Developer

Mehdi Chaouch mehdichaouch

🤖
Happiness Developer
View GitHub Profile
@kibotu
kibotu / DecompileAPK.md
Last active February 3, 2020 00:00
Download APK from Device
@Tomasz-Silpion
Tomasz-Silpion / payments.sql
Created July 20, 2016 17:20
Get all customers payment methods between range of dates from Magento database
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')
@olih
olih / jq-cheetsheet.md
Last active April 22, 2025 04:14
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@SmetDenis
SmetDenis / ignores.php
Last active October 9, 2020 14:00
Ignores for PHP inspections
<?php
// https://pear.php.net/manual/en/package.php.php-codesniffer.advanced-usage.php
// @codingStandardsIgnoreLine
// @codingStandardsIgnoreFile
// @codingStandardsIgnoreStart
// @codingStandardsIgnoreEnd
// https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.codeCoverageIgnore
// @codeCoverageIgnore
@mehdichaouch
mehdichaouch / magento-permissions.sh
Last active September 30, 2018 22:31
Script to fix Magento file permissions
#!/bin/bash
###############################
### Magento Permissions
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && chmod o+w var var/.htaccess includes includes/config.php app/etc && chmod 550 pear && sudo find *.sh -type f -exec chmod 755 {} \;
rm -rf var/cache/*
rm -rf var/session/*
@Nolwennig
Nolwennig / flush_email_queue_recipients.sql
Last active January 8, 2018 18:11
Magento flush email queue recipients
DELETE
FROM `core_email_queue_recipients`
WHERE `core_email_queue_recipients`.`message_id` NOT IN
(
SELECT `core_email_queue`.`message_id`
FROM `core_email_queue`
)
@parmentf
parmentf / GitCommitEmoji.md
Last active April 29, 2025 11:20
Git Commit message Emoji
@rugbymauri
rugbymauri / xxx-magento.json
Created November 17, 2015 13:03
PimpMyLog: Magento system.log configuration
{
"semart" : {
"display" : "xxx Magento",
"path" : "\/home\/xxx\/public_html\/yyyy\/magento\/var\/log\/system.log",
"refresh" : 5,
"max" : 10,
"export" : true,
"notify" : true,
"tags" : [ "magento"],
"multiline" : "",
setInterval(function updateClock() {
var currentTime = new Date();
var currentHours = currentTime.getHours();
var currentMinutes = currentTime.getMinutes();
var currentSeconds = currentTime.getSeconds();
// Pad the minutes and seconds with leading zeros, if required
currentMinutes = (currentMinutes < 10 ? "0" : "") + currentMinutes;
currentSeconds = (currentSeconds < 10 ? "0" : "") + currentSeconds;
// Choose either "AM" or "PM" as appropriate
@rponte
rponte / get-latest-tag-on-git.sh
Last active December 9, 2024 00:27
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples