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 / generate-git-branch-name-from-jira-issue.html
Last active December 12, 2022 14:01
🌿 Bookmarklet to generate a Git branch name from Jira issue
<!doctype html>
<html lang="en">
<head>
<meta name="description" content="Bookmarklet - Generate a Git branch name from Jira issue by Mehdi Chaouch">
<meta name="keywords" content="Bookmarklet,Git,Jira,issue">
<meta name="author" content="Mehdi Chaouch">
<!-- Author: https://gist.github.com/mehdichaouch -->
<!-- Required meta tags -->
<meta charset="utf-8">
@mehdichaouch
mehdichaouch / bookmarklet_hagglezon.com.js
Created May 23, 2021 17:25
Bookmarklet send Amazon product to Hagglezon which allow to compare prices across all Amazon european stores
(function() {
var lang = navigator.language.split('-')[0],
amazonPattern = /amazon.(com|co\.uk|ca|de|fr|es|it|cn|co\.jp).*\/(asin|dp|gp|product|exec\/obidos|gp\/offer-listing|product\-reviews|gp\/aw\/d)\/[A-Z0-9]{10,13}/i,
isAmazon = location.href.search(amazonPattern) >= 0;
if (isAmazon) try {
var r = document.getElementById("ASIN").value;
window.open("https://www.hagglezon.com/" + lang + "/s/" + encodeURIComponent(window.location.origin + "/dp/" + r), "_blank")
} catch (d) {
window.open("http://github.com/mehdichaouch/bookmarklets", "_blank")
}
@mehdichaouch
mehdichaouch / raspi-config.txt
Created April 24, 2021 22:39 — forked from damoclark/raspi-config.txt
Simple Raspbian Configuration Tool. Add file to boot partition of SD Card and run single command after booting Raspbian.
#/bin/sh
#
# Don't change the following lines unless you know what you are doing
# They execute the config options starting with 'do_' below
grep -E -v -e '^\s*#' -e '^\s*$' <<END | \
sed -e 's/$//' -e 's/^\s*/\/usr\/bin\/raspi-config nonint /' | bash -x -
#
############# INSTRUCTIONS ###########
#
# Change following options starting with 'do_' to suit your configuration
@mehdichaouch
mehdichaouch / m2-dev-tools.sh
Last active November 29, 2022 21:31
m2-dev-tools.sh
#!/bin/bash
###
# @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
# @author Mehdi Chaouch <mehdi@advocodo.com> <@advocodo>
# @copyright Copyright (c) 2020 ADVOCODO (https://www.advocodo.com)
# @description This script install some developer tools for Magento 2
# @usage ./m2-dev-tools.sh
###
@mehdichaouch
mehdichaouch / magento2_debug_ui_component.js
Created December 17, 2020 10:16
Magento 2 - Debug UI Component (showing spinner) #magento2 #uicomponent
// https://magento.stackexchange.com/questions/310578/how-to-debug-ui-component-only-showing-spinner
// https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/javascript/js_logger.html
require(['Magento_Ui/js/lib/logger/console-logger',
'Magento_Ui/js/lib/logger/levels-pool'],
function(logger, levels) {
logger.setDisplayLevel(5) // 2 = WARN 5 = ALL, see levels-pool.js
}
);
@mehdichaouch
mehdichaouch / install_xdebug.sh
Created December 3, 2020 14:35
Quick setup for Xdebug
#!/bin/bash
yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_connect_back = 1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_port = 9000" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.scream = 0" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.show_local_vars = 1" >> /usr/local/etc/php/conf.d/xdebug.ini \
@mehdichaouch
mehdichaouch / backup_google_chrome_important_files.sh
Created April 25, 2020 15:05
Automatically backup Google Chrome important files ('Current Session','Current Tabs','Last Session','Last Tabs','Bookmarks','Preferences') to Google Drive by default. This can be added in crontab for more efficiency.
#!/bin/sh
###
# @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
# @author Mehdi Chaouch <mehdi@advocodo.com> <@advocodo>
# @copyright Copyright (c) 2020 ADVOCODO (https://www.advocodo.com)
###
#set -v
#set -x
@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.
------------------------------------------------------------------------------------------