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
@mehdichaouch
mehdichaouch / magento_website_payment_method_transactions.sql
Last active March 26, 2020 09:30
Get all payment methods count by website from Magento database #Magento #Magento1 #sql #query
SELECT
cw.name AS 'Website',
p.method AS 'Payment method code',
CASE
WHEN p.method = "pbridge_ogone_direct_debit" THEN ''
WHEN p.method = "forter_dummy" THEN ''
WHEN p.method = "crretail_offlineonepay" THEN '1PAY'
WHEN p.method = "crretail_offlinecreditcardamericanexpress_ipp" THEN 'AMEX IPP'
WHEN p.method = "crretail_alipay" THEN 'Alipay'
WHEN p.method = "moneybookers_pwy" THEN 'All Polish Banks'
@mehdichaouch
mehdichaouch / google-dorks
Created March 22, 2020 17:54 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@mehdichaouch
mehdichaouch / google-dorks
Created March 22, 2020 17:53
Listing of a number of useful Google dorks.
Explanations:
cache: If you include other words in the query, Google will highlight those words within
the cached document. For instance, [cache:www.google.com web] will show the cached
content with the word “web” highlighted. This functionality is also accessible by
clicking on the “Cached” link on Google’s main results page. The query [cache:] will
show the version of the web page that Google has in its cache. For instance,
[cache:www.google.com] will show Google’s cache of the Google homepage. Note there
can be no space between the “cache:” and the web page url.
------------------------------------------------------------------------------------------
@mehdichaouch
mehdichaouch / instagram-token-generator.php
Created October 20, 2019 22:48
Facebook / Instagram User Access Token Generator
<?php
/**
* Facebook / Instagram User Access Token Generator
*
* Documentation: https://developers.facebook.com/docs/instagram-basic-display-api
*
* With this code snippet not error like:
*
* {
* "error_type": "OAuthException",
@mehdichaouch
mehdichaouch / upgrade-x.x.x.x-y.y.y.y.php
Created September 24, 2019 08:39
Magento logging not working in Open Source 1.9.4.1 and Commerce 1.14.4.1 or after SUPEE-11086
<?php
/**
* Set values for allowedFileExtensions
*/
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
@mehdichaouch
mehdichaouch / email_notify.php
Created September 12, 2019 07:10
Magento 1 - Email notification via Magento email queue
<?php
public function emailNotify($event, $emailTemplate, $data, $toEmail)
{
$data = array_merge($data, array('YYYYMMDDHHMMSS' => date('Ymdhis')));
/* @var $template Mage_Core_Model_Email_Template */
$template = Mage::getModel('core/email_template')->loadDefault($emailTemplate);
$notifyTemplate = $template->getProcessedTemplate($data);
$notifyTemplateSubject = $template->getProcessedTemplateSubject($data);
@mehdichaouch
mehdichaouch / dl_google_site_kit.sh
Last active September 10, 2019 07:00
Bash Shell script - Download latest version of Google Site Kit for WordPress via CLI
#!/bin/bash
curl -LsSO https://sitekit.withgoogle.com/service/download/google-site-kit.zip &&
unzip google-site-kit.zip &&
rm google-site-kit.zip
@mehdichaouch
mehdichaouch / github_latest_tag.sh
Created September 4, 2019 14:31
Bash Shell script - Get latest tag from GitHub API via CLI
#!/bin/bash
curl --silent "https://api.github.com/repos/google/site-kit-wp/tags" | grep '"name":' | sed -E 's/.*"([^"]+)".*/\1/' | head -n1
@mehdichaouch
mehdichaouch / m1-dev-tools.sh
Last active December 27, 2019 14:03
This script install some developer tools for Magento 1
#!/bin/bash
###
# @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
# @author Mehdi Chaouch <[email protected]> <@advocodo>
# @copyright Copyright (c) 2019 ADVOCODO (https://www.advocodo.com)
# @description This script install some developer tools for Magento 1
# @usage ./m1-dev-tools.sh
###
@mehdichaouch
mehdichaouch / git-branching-name-from-redmine-to-clipboard.md
Last active September 3, 2019 13:35
Create Bookmarklet (browser bookmark that executes Javsacript) to copy a Git branching name from Redmine to Clipboard.

Copy-to-clipboard Git branching name from Redmine bookmarklet

Create Bookmarklet (browser bookmark that executes Javsacript) to copy a Git branching name from Redmine to Clipboard.

Format: feature/[issue #]-[issue title] (can be changed bellow).

This is the base javascript:

(function(text){