Skip to content

Instantly share code, notes, and snippets.

View r-martins's full-sized avatar

Ricardo Martins r-martins

View GitHub Profile
@Exon0
Exon0 / Annotations to attributes symfony 5.4
Last active November 20, 2023 04:29
Annotations to attributes symfony 5.4
Follow these steps to refactor annotations to attributes in a symfony 5.4+ project
### **Annotation to attribute steps:** ##
1) Install rector:
composer require rector/rector --dev
2) Create rector.php
vendor/bin/rector init
3) Add the following code to rector.php
```
@7rin0
7rin0 / apache2_vhost_config_vuejs_dist
Created June 18, 2018 13:50
VueJS: Apache / Nginx vhost config examples
<VirtualHost *:80>
DocumentRoot "/home/dev/server/project/dist/"
ServerName vuejs.project.local
<Directory /home/dev/server/project/dist/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted
Order allow,deny
allow from all
@xurizaemon
xurizaemon / eway_response_codes.csv
Created May 16, 2016 03:41
eWay Response Codes
ResponseMessage Reason
A2000 Transaction Approved
A2008 Honour With Identification
A2010 Approved For Partial Amount
A2011 Approved, VIP
A2016 Approved, Update Track 3
D4401 Refer to Issuer
D4402 Refer to Issuer, special
D4403 No Merchant
D4404 Pick Up Card
@yvoronoy
yvoronoy / my.cnf
Last active December 22, 2022 17:57
MySQL Magento Config
[mysqld]
## After edit config you have to remove log files and restart mysql server
## because after changing innodb-log-file-size you should recreate ib_logfiles
## Stop MySQL server
## rm /data/dir/ib_logfile*
## Run MySQL server
##Table open cache under MacOS and MySQL 5.6 should be 250.
##Otherwise you will get error MySQL server has gone away
##table-open-cache = 250
@drmmr763
drmmr763 / default
Last active June 15, 2018 11:35
mautic-symfony-nginx
server {
listen 80;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name _;
location / {
@fhferreira
fhferreira / BIN.txt
Last active January 24, 2022 19:16
Credit Card Validation
Elo:
/^((((636368)|(438935)|(504175)|(451416)|(636297))\d{0,10})|((5067)|(4576)|(4011))\d{0,12})$/
Hipercard:
/^(606282\d{10}(\d{3})?)|(3841\d{15})$/
-----------------------------------------
| Bandeira | Comeca com | Máximo de número | Máximo de número cvc |
| ---------- | ------------------------------------------- | ---------------- | -------------------- |
@BFTrick
BFTrick / create-custom-setting.php
Created July 29, 2014 17:38
Generate a custom button within the Integration tab.
/**
* Initialize integration settings form fields.
*
* @return void
*/
public function init_form_fields() {
$this->form_fields = array(
// don't forget to put your other settings here
'customize_button' => array(
@zdravkok
zdravkok / del-attr-values
Created May 19, 2014 12:19
Delete unused attribute values from Magento
DELETE o, v
FROM eav_attribute a
INNER JOIN eav_attribute_option o ON a.attribute_id = o.attribute_id
INNER JOIN eav_attribute_option_value v ON v.option_id = o.option_id
INNER JOIN eav_entity_type t ON t.entity_type_id = a.entity_type_id
LEFT JOIN catalog_product_entity_int pi ON o.option_id = pi.value AND o.attribute_id = pi.attribute_id
LEFT JOIN catalog_product_entity_varchar pv ON o.option_id = pv.value AND o.attribute_id = pv.attribute_id
WHERE pi.entity_id IS NULL
AND pv.entity_id IS NULL
AND t.entity_type_code = "catalog_product"
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
@peterjaap
peterjaap / quickmodman
Created January 16, 2013 10:52
Quickly generate modman file for Magento extensions
for i in `find . -type f | grep -v \.git | grep -v "^.$" | grep -v "modman" | sed 's/\.\///'`; do echo ${i} ${i}; done > modman