Skip to content

Instantly share code, notes, and snippets.

Luiz Venturote luizventurote

Block or report user

Report or block luizventurote

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@luizventurote
luizventurote / m2theme.sh
Last active Aug 29, 2019
Bash script to deploy Magento 2 theme static content.
View m2theme.sh
#!/usr/bin/env bash
echo "M2 - Deploy Static Content $1/$2 🚀"
rm -rf var/view_preprocessed/pub/static/frontend/$1/$2
rm -rf var/view_preprocessed/source/frontend/$1/$2
grunt exec:$2
@luizventurote
luizventurote / valet-sample-magento.sh
Last active May 9, 2018
Bash script to install a Magento store with sample data automatically using Valet Plus and n98-magerun.
View valet-sample-magento.sh
#!/usr/bin/env bash
folderName=${PWD##*/}
magentoUser="MAGENTO_PUBLIC_KEY"
magentoPassword="MAGENTO_SECRET_KEY"
n98-magerun2.phar install --dbHost="localhost" --dbUser="root" --dbPass="root" --dbName="${folderName}" --installationFolder="magento-folder" --installSampleData=yes --baseUrl="http://${folderName}.test/"
mv magento-folder/* .
@luizventurote
luizventurote / fix-header-script.js
Last active Apr 5, 2018
Javascript code to fix the header in the top.
View fix-header-script.js
jQuery(function($){
var header = document.querySelector('header.page-header .header.content'),
panel = document.querySelector('header.page-header .panel'),
$panel = jQuery(panel),
$header = jQuery(header),
headerContainer = document.querySelector('header.page-header'),
$headerContainer = jQuery(headerContainer),
lastScroll = 0,
upSign = -1,
@luizventurote
luizventurote / magento1-layout-cms.xml
Created Mar 2, 2018
Add head text by on a CMS page - Magento 1
View magento1-layout-cms.xml
<reference name="head">
<block type="core/text" name="custom_css">
<action method="setText">
<text><![CDATA[
<style type="text/css">
View opencv-load-video.cpp
#include <iostream>
#include <stdio.h>
#include "opencv2/highgui/highgui.hpp"
int main( int argc, const char** argv ) {
cvNamedWindow("Example2", CV_WINDOW_AUTOSIZE);
CvCapture* capture = cvCreateFileCapture( argv[1] );
View opencv-load-image.cpp
#include <iostream>
#include <stdio.h>
#include "opencv2/highgui/highgui.hpp"
int main( int argc, const char** argv ) {
IplImage* img = cvLoadImage( argv[1] );
cvNamedWindow("Example1", CV_WINDOW_AUTOSIZE);
cvShowImage("Example1", img);
cvWaitKey(0);
@luizventurote
luizventurote / findLocalItems.js
Created Dec 25, 2017 — forked from n0m4dz/findLocalItems.js
how to filter keys from localStorage with a regex
View findLocalItems.js
// returns an array of localStorage items in key/value pairs based on a query parameter
// returns all localStorage items if query isn't specified
// query can be a string or a RegExp object
function findLocalItems (query) {
var i, results = [];
for (i in localStorage) {
if (localStorage.hasOwnProperty(i)) {
if (i.match(query) || (!query && typeof i === 'string')) {
value = JSON.parse(localStorage.getItem(i));
@luizventurote
luizventurote / WordPress.class.php
Created Oct 7, 2017 — forked from Jamesking56/WordPress.class.php
Read Wordpress Export XML to PHP
View WordPress.class.php
<?php
/**
* WordPress class - Manages the WordPress XML file and gets all data from that.
*/
class Wordpress
{
public static $wpXML;
@luizventurote
luizventurote / install-php-extensions-mamp-pro-4.md
Created Aug 12, 2017
Install custom PHP extensions for MAMP PRO 4
View install-php-extensions-mamp-pro-4.md

Install custom PHP extensions for MAMP PRO 4

Example extension: gmp on a MAMP PRO with PHP 5.6.27 installation. For other versions it's just replacing the php version in the paths. Steps below are tested on MacOS Sierra (10.12.2).

Prerequisites

Install Brew and MAMP PRO.

@luizventurote
luizventurote / download-commit-bitbucker.md
Created Jul 25, 2017
Download source code for a particular commit in Bitbucket
View download-commit-bitbucker.md
https://bitbucket.org/USERNAME/REPONAME/get/COMMITCODE.tar.gz
You can’t perform that action at this time.