Skip to content

Instantly share code, notes, and snippets.

View claudiu-marginean's full-sized avatar

Claudiu Marginean claudiu-marginean

View GitHub Profile
@claudiu-marginean
claudiu-marginean / Makefile
Created March 15, 2023 09:16 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@claudiu-marginean
claudiu-marginean / Other Stuff.md
Last active July 12, 2018 07:12
Developer Notebook #1

test

@claudiu-marginean
claudiu-marginean / MockeryMockIterator.php
Last active May 24, 2018 08:27 — forked from pgraham/gist:4127832
function to create a mock iterator over an array using PHP Mockery lib
/**
* Create a mock iterator over the given array.
*
* @param array $a
* @param string $class The class to use for the mock, should be/implement/extend Iterator
* @param boolean $complete Whether or not to build a complete iteration. This is
* used when an exception/break is expected in the middle of the iteration.
* @param integer $numElms The number of elements that should be iterated in the case of an
* incomplete iteration.
*/
@claudiu-marginean
claudiu-marginean / change_eav_attribute_type.sql
Created February 8, 2016 14:36
Magento Change EAV Attribute type
#
# Change EAV Attribute Type from dropdown to multipleselect
# - copy old attribute values to new table
#
dropdown attribute_id = 137
UPDATE eav_attribute SET
backend_model = 'eav/entity_attribute_backend_array',
frontend_input = 'multiselect',
@claudiu-marginean
claudiu-marginean / js_translate.phtml
Last active September 1, 2015 09:57
Magento 1.x JS Translation in template files
<script>
//<![CDATA[
Translator.add(
<?php echo Mage::helper('core')->jsonEncode(array(
'Please use letters only.' => $this->__('Please use letters only.'),
'Please use letters only.' => $this->helper('jstranslate')->__('Please use letters only.'),
)) ?>
);
//]]>
</script>
@claudiu-marginean
claudiu-marginean / GIT - Assume Unchanged
Last active March 27, 2022 01:16
GIT - Assume Unchanged
Aveti aici niste comenzi foarte utile pentru situatiile in care vreti sa evitati sa faceti in mod repetat stash-uri la o serie de fisiere de configurari locale, pe care nu trebuie nici sa le comiteti pe un proiect, si nici sa le puneti in gitignore pentru ca fisierele exista si sunt necesare pe branchurile superioare.
In aceste cazuri puteti folosi:
### Pentru a opri tracking-ul fisierului
```git update-index --assume-unchanged <file>```
On Windows use:
```git ls-files -v | grep "^[a-z]"```
@claudiu-marginean
claudiu-marginean / httpd-vhosts.conf
Last active August 29, 2015 14:08 — forked from anonymous/httpd-vhosts.conf
VirtualHost in XAMPP with https (with certif from localhost)
<VirtualHost *:80>
DocumentRoot "D:/www/project-name"
ServerName local.project-name.net
ServerAlias local.project-name.net
#SetEnv MAGE_IS_DEVELOPER_MODE "true"
<Directory "D:/www/project-name">
Options Indexes FollowSymLinks
AllowOverride All
@claudiu-marginean
claudiu-marginean / gist:7724599
Last active December 29, 2015 20:38
Git Ignore

Git Ignore - Global

Path to this depends on you global git config "excludesfile".

Mine is: excludesfile = C:\\www\\gitignore_global.txt

#IDE project files
/.idea
#composer files and lib folder
/vendor
@claudiu-marginean
claudiu-marginean / Magento-Snippets-Claudiu.md
Last active July 6, 2021 08:54
Magento Snippets - Claudiu

Magento Snippets

Code snippets from different sections of Magento that are very useful.

JS Translation in phtml files

<script>
//<![CDATA[
Translator.add(
    <?php echo Mage::helper('core')->jsonEncode(array(
@claudiu-marginean
claudiu-marginean / update_product_attribute
Last active December 12, 2015 10:48
Update Product Attributes
<?php
/**
* This code only updates the attributes you want to change.
* The first paramater is an array of product IDs,
* the second is an array of attribute names and values,
* and then the third is the store ID you wish to update.
* This is MUCH faster than saving the entire model.
* Ref Link: http://stackoverflow.com/questions/3669211/saving-in-magento-taking-a-very-very-long-time
*/