Skip to content

Instantly share code, notes, and snippets.

View fernandoperigolo's full-sized avatar

Luiz Fernando de Souza Filho fernandoperigolo

View GitHub Profile
@fernandoperigolo
fernandoperigolo / compose.js
Last active September 12, 2017 13:13
This is a example about how implement Compose Technique in Javascript.
(function(){
// Adding compose to Function prototype
Function.prototype.compose = function(argFn) {
var fnToCall = this;
return function() {
// This line is really complex and i don't know exactly what this line do
return fnToCall.call(this, argFn.apply(this,arguments));
}
}
@fernandoperigolo
fernandoperigolo / server.conf
Created November 1, 2016 19:20
Use this NGINX server conf to run more than one Magento instalation on server. You can access based on folder. Works copy and past if you created a machine using puphpet.com
server {
listen *:80;
server_name awesome.dev;
client_max_body_size 30m;
set $basepath "/var/www";
set $domain $host;
if ($domain ~ "^(.*)\.awesome\.dev$") {
set $project $1;
@fernandoperigolo
fernandoperigolo / searchByTaxvat.sql
Created March 20, 2017 13:03
This is a Query for Magento where you can search a customer by taxvat. The entity_id result is the ID of customer, so you can find easily in Magento admin
SELECT * FROM customer_entity_varchar WHERE value = "12312312312";
@fernandoperigolo
fernandoperigolo / ebitsuccess.phtml
Created August 24, 2017 18:23
Monta tag do banner do Ebit na página de sucesso do Magento 1 com o lightbox
<?php
$order = Mage::getModel('sales/order');
$order->loadByIncrementId($this->getOrderId());
$amount = number_format($order->getGrandTotal(),2);
$email = $order->getCustomerEmail();
$dob = $order->getCustomerDob();
$dob = explode(' ', $dob);
$dob2 = explode('-', $dob[0]);
$dobYear = $dob2[0];
$dobMonth = $dob2[1];
import React, { Component, Fragment } from 'react'
import { connect } from 'react-redux'
import { handleGetAllPosts } from '../actions/posts'
class PostList extends Component {
componentDidMount () {
this.props.getAllPosts()
}
render() {
const { posts } = this.props
@fernandoperigolo
fernandoperigolo / index.html
Created December 21, 2019 00:41
Javascript redirect example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Form Redirect</title>
</head>
<body>
<h1>Luiz Cloud</h1>
@fernandoperigolo
fernandoperigolo / index.html
Created April 25, 2023 17:40
Identify user HubPost
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>