Skip to content

Instantly share code, notes, and snippets.

View elisei's full-sized avatar
:octocat:
Isto fica feliz em ser útil!

Bruno elisei

:octocat:
Isto fica feliz em ser útil!
View GitHub Profile
  1. Generate the file:
$ awk 'BEGIN { for(c=0;c<10000000;c++) printf "<p>LOL</p>" }' > 100M.html
$ (for I in `seq 1 100`; do cat 100M.html; done) | pv | gzip -9 > 10G.boomgz
  1. Check it is indeed good:
@elisei
elisei / facebook-wca-standard-events.html
Created June 15, 2021 16:26 — forked from danielmcclure/facebook-wca-standard-events.html
Sample Facebook Standard Events for New Facebook WCA (Website Custom Audience) Pixel
<!-- Facebook Custom Audience Pixel Code - Placed on Every Page of Site -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '{{facebook pixel}}');
fbq('track', 'PageView');
</script>
@elisei
elisei / find_cacheable_false.sh
Created September 20, 2020 13:25 — forked from jeroenvermeulen/find_cacheable_false.sh
Magento2: Find cacheable="false" in layout XML
#### by MageHost.pro ####
# execute in Magento 2 root:
find vendor app -regextype 'egrep' -type f -regex '.*/layout/.*\.xml' -not -regex '.*(vendor/magento/|/checkout_|/catalogsearch_result_|/dotmailer).*' | xargs grep --color -n -e 'cacheable="false"'
sudo apt-get update
sudo apt-get install apt-transport-https openjdk-8-jre-headless
sudo wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-6.x.list
sudo apt-get update && sudo apt-get install elasticsearch
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
sudo ls -la /var/log/elasticsearch/
@elisei
elisei / .php_cs.dist
Created January 25, 2020 00:04 — forked from joaorobertopb/.php_cs.dist
Esse é um exemplo de configuração do php-cs-fixer que foi construído usando a predefinição Laravel do StyleCI.
<?php
$header = <<<'EOF'
Esse arquivo faz parte de <Empresa/Projeto>
(c) Nome Autor <e-mail>
Lorem ipsum ...
EOF;
@elisei
elisei / install_lamp_18.sh
Created December 18, 2018 01:12 — forked from ankurk91/install_lamp_ubuntu.sh
Ubuntu 18.04 - PHP development (php 7.2, MySQL 5.7, apache 2.4)
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Ubuntu 18.04 dev Server
# Run like - bash install_lamp.sh
# Script should auto terminate on errors
echo -e "\e[96m Adding PPA \e[39m"
sudo add-apt-repository -y ppa:ondrej/apache2
@elisei
elisei / dob.phtml
Created June 1, 2018 13:56 — forked from dele454/dob.phtml
Magento DOB widget with DOB Validation
<?php
/**
* @see Mage_Customer_Block_Widget_Dob
*/
?>
<label class="dob-label" for="<?php echo $this->getFieldId('month')?>"<?php if ($this->isRequired()) { echo ' class="required"'; } ?>><?php echo $this->__('Birthday') ?></label>
<div class="customer-dob input-box">
<div class="dob-year">
<?php $currentYear = intval(date("Y")); ?>
<select name="<?php echo $this->getFieldName('year'); ?>" id="<?php echo $this->getFieldId('year'); ?>">
@elisei
elisei / rest_test.php
Created February 22, 2018 13:22 — forked from xcommerce-gists/rest_test.php
Magento coupon code generator test script
<?php
/********************************************************************
File name: rest_test.php
Description:
A PHP test script that calls the Coupon AutoGen extension
to Magento's REST API.
The Coupon AutoGen API takes:
-- the rule ID of the &quot;Generate Coupons&quot; rule to execute
-- the number of coupon codes to generate
-- the length of each coupon code
@elisei
elisei / local.xml
Created June 13, 2017 19:14 — forked from MikeWilkie/local.xml
Magento – Disable Excessive Logging and Reporting in app/etc/local.xml
<?xml version="1.0"?>
<!-- license -->
<config>
<global>
<!-- global config -->
</global>
<frontend>
<events>
<!-- disble logs -->
<controller_action_predispatch>
@elisei
elisei / addExportButtonMagentoRecurringProfiles.php
Created January 20, 2017 20:33 — forked from tegansnyder/addExportButtonMagentoRecurringProfiles.php
To add a export button to Magento Recurring Profiles edit this file: /app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php
<?php
// ADD THIS CODE
/**
* Export order grid to CSV format
*/
public function exportCsvAction()
{
$fileName = 'subscriptions.csv';