Skip to content

Instantly share code, notes, and snippets.

View deivisonarthur's full-sized avatar

Deivison Arthur Lemos Serpa deivisonarthur

View GitHub Profile
@deivisonarthur
deivisonarthur / responsive_likebox.html
Created May 3, 2017 03:06
Responsive Facebook Like Box
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container" style="width:100%;">
<div class="fb-like-box" data-href="https://www.facebook.com/adobegocreate" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div>
</div>
@deivisonarthur
deivisonarthur / delete_all_customers.sql
Created December 2, 2016 19:42 — forked from michelbrito/delete_all_customers.sql
Magento - Delete all customers
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `customer_address_entity`;
TRUNCATE TABLE `customer_address_entity_datetime`;
TRUNCATE TABLE `customer_address_entity_decimal`;
TRUNCATE TABLE `customer_address_entity_int`;
TRUNCATE TABLE `customer_address_entity_text`;
TRUNCATE TABLE `customer_address_entity_varchar`;
TRUNCATE TABLE `customer_entity`;
TRUNCATE TABLE `customer_entity_datetime`;
@deivisonarthur
deivisonarthur / magento
Last active September 29, 2016 00:25
Magento Daemon - restart/stop/status services nginx/varnish/php-fpm/memcached - Entrar em /etc/rc.d/init.d/ ou /etc/init.d e criar o arquivo magento com touch com os seguintes parametros
#!/bin/sh
#
# magento - this script starts and stops the magento daemon
#
# chkconfig: - 85 15
# description: magento is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: magento
# pidfile: /var/run/magento.pid
@deivisonarthur
deivisonarthur / Atributo-Tipopessoa.php
Last active September 21, 2016 23:43
OSC 6 Pro - Remoção do atributo tipopessoa do OSC 4 antigo da tabela eav-attribute (O erro apresentando: Falha ao carregar módulo da configuração. Exemplo do erro http://screencast.com/t/Y9KmWizPsob2) - Adicione esse arquivo na raiz do magento, rode ele pelo navegador e depois o exclua.
<?php
include_once 'app/Mage.php';
//Mage::app('default');
Mage::app();
$installer->startSetup();
@deivisonarthur
deivisonarthur / setup.php
Created November 12, 2014 03:58
Como remover atributos das categorias do magento (atributo fdp criado por theme comprada) ERRO: Modelo base "neoshopsettings/blockposition" não encontrado para o atributo "category_block_position" - da template neoshop do themeforest
<?php
include_once 'app/Mage.php';
//Mage::app('default');
Mage::app();
$installer = Mage::getResourceModel('catalog/setup','catalog_setup');
@deivisonarthur
deivisonarthur / mage-dbdump-sales-users
Created November 3, 2015 14:21 — forked from seangreen/mage-dbdump-sales-users
Shell Script to Dump / Import Magento Sales and Customers
#!/bin/bash
# VARIABLES
CONFIG_FILE="./app/etc/local.xml"
DUMP_FILE="./var/db-sales-users.sql"
TABLES="sales_bestsellers_aggregated_daily sales_bestsellers_aggregated_monthly sales_bestsellers_aggregated_yearly sales_billing_agreement sales_billing_agreement_order sales_flat_creditmemo sales_flat_creditmemo_comment sales_flat_creditmemo_grid sales_flat_creditmemo_item sales_flat_invoice sales_flat_invoice_comment sales_flat_invoice_grid sales_flat_invoice_item sales_flat_order sales_flat_order_address sales_flat_order_grid sales_flat_order_item sales_flat_order_payment sales_flat_order_status_history sales_flat_quote sales_flat_quote_address_item sales_flat_quote_item sales_flat_quote_item_option sales_flat_quote_payment sales_flat_quote_shipping_rate
sales_flat_shipment sales_flat_shipment_comment sales_flat_shipment_grid sales_flat_shipment_item sales_flat_shipment_track sales_invoiced_aggregated sales_invoiced_aggregated_order sales_order_aggregated_created sales_order_aggregated_updated sales_order_statu
<?php
//Table names and table prefixes
$tableName = Mage::getSingleton('core/resource')
getTableName('catalog_product_entity');
// if prefix was 'mage_' then the below statement
// would print out mage_catalog_product_entity
echo $tableName;
//Accessing the database connection resource
@deivisonarthur
deivisonarthur / _install.php
Created July 29, 2013 20:16
Sendy.co decript install page - remove validation domain
<?php
${"\x47LO\x42A\x4c\x53"}["\x6e\x6f\x73\x77\x66\x61\x70\x64\x67\x68z"]="\x74\x69\x6d\x65\x7a\x6fne";
${"G\x4cO\x42\x41\x4c\x53"}["\x6foi\x70\x70l"]="\x61w\x73_k\x65\x79";
${"\x47\x4cO\x42\x41\x4c\x53"}["\x63\x71\x65\x75e\x71\x78\x76"]="\x6e\x61m\x65";
${"\x47\x4cO\x42\x41\x4cS"}["w\x6e\x6a\x70\x6a\x6b\x66"]="\x725";
${"\x47\x4cOB\x41\x4cS"}["\x68\x61\x61s\x75\x79\x64\x70\x65a"]="\x723";
${"G\x4c\x4f\x42AL\x53"}["\x63\x69q\x67\x67p\x75"]="\x716";
${"\x47L\x4f\x42\x41L\x53"}["yek\x74\x6d\x74\x70"]="\x72\x36";
${"\x47L\x4fBA\x4c\x53"}["\x69\x7a\x68\x78em\x78j\x77\x68"]="\x72\x32";
${"\x47L\x4fB\x41LS"}["ico\x6ayr\x75o\x6e"]="\x72\x31";
<?php
function proxy_detect ($null) {
$proxyports=array(80,8080,6588,8000,3128,3127,3124,1080,553,554);
for ($i = 0; $i <= count($proxyports); $i++) {
if(@fsockopen($_SERVER['REMOTE_ADDR'],$proxyports[$i],$errstr,$errno,0.5)){
$sockport=true;
}
}
if(
$_SERVER['HTTP_FORWARDED']
<?php
## Function to set file permissions to 0644 and folder permissions to 0755
function AllDirChmod( $dir = "./", $dirModes = 0755, $fileModes = 0644 ){
$d = new RecursiveDirectoryIterator( $dir );
foreach( new RecursiveIteratorIterator( $d, 1 ) as $path ){
if( $path->isDir() ) chmod( $path, $dirModes );
else if( is_file( $path ) ) chmod( $path, $fileModes );
}