Skip to content

Instantly share code, notes, and snippets.

@mokanfar
mokanfar / User-keybindings.json
Last active May 17, 2020
sublime text settings json
View User-keybindings.json
[
{
"keys": [
"ctrl+b"
],
"command": "show_overlay",
"args": {
"overlay": "command_palette"
}
},
View hot virtual keyboard 08-2019
;Kiosk Keyboard with Skins
;
;Copyright (c) 2006-2015 Comfort Software Group
;ALL RIGHTS RESERVED
Height=152
Width=276
DefaultFitWidth=0
DefaultLockAspectRatio=1
DefaultMoveToBottom=0
DefaultCenterInfo=1
View strokeit.sxp
<VERSION>StrokeIt .9.4</VERSION>
<APP name="Default">
Close Window [C] {
Alt+F4 = keys, hotkey "[ALT_DOWN][F4][ALT_UP]"
}
Down {
gesture = Down
New Command = keys, hotkey "[CTRL_DOWN][END][CTRL_UP]"
}
View dl.sh
#!/bin/env bash
#requirements wget
if [ -z "$1" ] && [ -z "$2" ]; then
echo "No url provided. exiting...";
elif [[ -z "$2" ]]; then
wget -r -l1 -H -t1 -nd -N -np -A jpg,jpeg,png,webm,gif -erobots=off $1;
rm *s.*
else
mkdir $2;
View Useful javascript snippets.js
//find sku in json object list return arg[1] of that object
const filterIt = (sku, attr) => {
let arr = list.filter(function(asdf) {
return asdf.SKU == sku;
});
return arr[0][attr];
};
//ramda find without for each
R.find(R.propEq('a', 2))(xs)
View CSS Responsive Skeleton Template
/*
====================================
Small Screen - Tablet
====================================
*/
@media screen and (min-width: 768px) and (max-width: 991px) {
@mokanfar
mokanfar / All Attribute Codes Global.txt
Last active Jun 29, 2019
Magmi Magento Import Necessary Columns
View All Attribute Codes Global.txt
name
short_description
sku
price
weight
color
notes
product_category_type
erp_sku
dimensions
View magento-code-snippets.md

Magento Code Snippets

Programatically Save Product Manually

<?php
$copypasta = <<< EOC
SKU1
SKU2
EOC;
$skus = explode(PHP_EOL, $copypasta);
@mokanfar
mokanfar / filter_unique_rows_script.sh
Last active Oct 23, 2018
Matched Rows, Unique Rows Merge Filter Bash Scripts for CSV files
View filter_unique_rows_script.sh
#!/usr/bin/env bash
echo "filename 1 (file that has more rows):"
read file1
echo "filename 2:"
read file2
echo "common field name:"
read fieldname
#echo "file1: ${file1}.csv file2: ${file2}.csv common field name: ${fieldname}"
if [ -f $PWD/temp.db ]; then
View get_final_price_of_skus_for_certain_customer_group.php
<?php
require_once 'app/Mage.php';
Mage::app();
//to overwrite limit but you need first to increase your memory limit
$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*') // select all attributes
->setPageSize(5000) // limit number of results returned
->setCurPage(1); // set the offset (useful for pagination)
// we iterate through the list of products to get attribute values