Skip to content

Instantly share code, notes, and snippets.

View harshvardhanmalpani's full-sized avatar
💯
life is a party!!

Harshvardhan Malpani harshvardhanmalpani

💯
life is a party!!
View GitHub Profile
@harshvardhanmalpani
harshvardhanmalpani / 0-step.js
Last active June 8, 2018 19:51
EMail addresses in my spam filter list
/* insert the following code in console jQuery v3.3.1 */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.protot
@harshvardhanmalpani
harshvardhanmalpani / letsencrypt-ca-bundle-new.crt
Last active March 12, 2018 20:58
Let's Encrypt Root CA Bundle
-----BEGIN CERTIFICATE-----
MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/MSQwIgYDVQQK
ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X
DTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0NlowSjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxl
dCdzIEVuY3J5cHQxIzAhBgNVBAMTGkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkq
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4
S0EFq6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8SMx+yk13
EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0Z8h/pZq4UmEUEz9l6YKH
y9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWAa6xK8xuQSXgvopZPKiAlKQTGdMDQMc2P
MTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQAB
@harshvardhanmalpani
harshvardhanmalpani / update-product-attribute-options.js
Created November 22, 2017 09:55
Manage Magento 2 product attribute options - values using JS console
$jq=new jQuery.noConflict();
var mimim=["Abalone",
"Titanium Druzy",
"Tourmaline",
"Turquoise",
"Yellow Zircon",
"Light Blue Druzy"];
var trans=[];var o=0;
$jq('#manage-options-panel tbody tr td:nth-child(3) input').each(
function(a,b){
@harshvardhanmalpani
harshvardhanmalpani / Magento-Product-CustomOptions-Duplicate-Remover.php
Created April 24, 2017 22:50
This code removes duplicate custom options for all products. Use toggle for test and debug.
<?php
$debug=0;
$test=0;
/*
Code by Harshvardhan Malpani - https://harshmalpani.in
Tested for Magento CE 1.9.x
Date: 25/04/2017
Use $debug and $test toggles to display messages.
This script will remove all duplicate custom options in each product (duplicate logic = same title for multiple custom options)
*/
@harshvardhanmalpani
harshvardhanmalpani / convertProductImages2Jpg.php
Last active January 5, 2017 18:13
Converts all magento images from PNG to JPG
<?php
$halfPath='./media/catalog/product';
$user="username"; //username for SOAPv2 api
$pass="password"; //password for above user
$products = array(20,21,22); //array of product IDs to be converted
ini_set('display_errors',E_ALL);
error_reporting(E_ALL);
define('MAGENTO_ROOT', getcwd());
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
require_once $mageFilename;