## Magento 1 + SampleData
sudo apt-get update && \
sudo apt-get install -y git wget unzip
git clone https://github.com/OpenMage/magento-mirror.git ./ ;
wget https://raw.githubusercontent.com/Vinai/compressed-magento-sample-data/1.9.1.0/compressed-magento-sample-data-1.9.1.0.tgz ;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
LANGUAGES="en_US pt_BR" | |
# production or developer | |
ENVIRONMENT="production" | |
COMPOSER=$(which composer) | |
PHP=$(which php) | |
ROOT=$(pwd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the each customer sales and orders total | |
SELECT | |
-- Round to two decimal places and prepend with $ | |
CONCAT('$', FORMAT(SUM(sales_flat_order.`grand_total`), 2)) AS 'Lifetime Sales', | |
COUNT(sales_flat_order.entity_id) AS 'Orders', | |
customer_entity.email AS 'Email', | |
MAX(sales_flat_order.created_at) AS 'Most Recent Order Date' | |
FROM `customer_entity` | |
LEFT JOIN sales_flat_order ON customer_entity.entity_id = sales_flat_order.customer_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Shopify\Auth\FileSessionStorage; | |
use Shopify\Auth\Session; | |
use Shopify\Context; | |
use Shopify\ApiVersion; | |
Context::initialize( | |
apiKey: 'NA', | |
apiSecretKey: 'NA', | |
scopes: ['read_products'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exemplo de requisição GET | |
var ajax = new XMLHttpRequest(); | |
// Seta tipo de requisição e URL com os parâmetros | |
ajax.open("GET", "minha-url-api.com/?name=Henry&lastname=Ford", true); | |
// Envia a requisição | |
ajax.send(); | |
// Cria um evento para receber o retorno. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function sign($method, $url, $data, $consumerSecret, $tokenSecret) | |
{ | |
$url = urlEncodeAsZend($url); | |
$data = urlEncodeAsZend(http_build_query($data, '', '&')); | |
$data = implode('&', [$method, $url, $data]); | |
$secret = implode('&', [$consumerSecret, $tokenSecret]); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FOREIGN_KEY_CHECKS=0; | |
TRUNCATE TABLE `customer_entity`; | |
TRUNCATE TABLE `customer_entity_datetime`; | |
TRUNCATE TABLE `customer_entity_decimal`; | |
TRUNCATE TABLE `customer_entity_int`; | |
TRUNCATE TABLE `customer_entity_text`; | |
TRUNCATE TABLE `customer_entity_varchar`; | |
TRUNCATE TABLE `customer_address_entity`; | |
TRUNCATE TABLE `customer_address_entity_datetime`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Facebook Pixel Code --> | |
<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', 'Put your pixel ID here'); | |
fbq('track', "PageView"); |
composer require "phpro/grumphp:^0.14" --dev
composer require nlubisch/grumphp-easycodingstandard --dev
composer require wearejust/grumphp-extra-tasks --dev
composer require jakub-onderka/php-parallel-lint --dev
NewerOlder