Skip to content

Instantly share code, notes, and snippets.


Luiz Venturote luizventurote

View GitHub Profile
luizventurote /
Last active Aug 29, 2019
Bash script to deploy Magento 2 theme static content.
#!/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 /
Last active Dec 4, 2019
Bash script to install a Magento store with sample data automatically using Valet Plus and n98-magerun.
#!/usr/bin/env bash
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 / fix-header-script.js
Last active Apr 5, 2018
Javascript code to fix the header in the top.
View fix-header-script.js
var header = document.querySelector(' .header.content'),
panel = document.querySelector(' .panel'),
$panel = jQuery(panel),
$header = jQuery(header),
headerContainer = document.querySelector(''),
$headerContainer = jQuery(headerContainer),
lastScroll = 0,
upSign = -1,
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">
<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);
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 / WordPress.class.php
Created Oct 7, 2017 — forked from Jamesking56/WordPress.class.php
Read Wordpress Export XML to PHP
View WordPress.class.php
* WordPress class - Manages the WordPress XML file and gets all data from that.
class Wordpress
public static $wpXML;
luizventurote /
Created Aug 12, 2017
Install custom PHP extensions for MAMP PRO 4

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).


Install Brew and MAMP PRO.

luizventurote /
Created Jul 25, 2017
Download source code for a particular commit in Bitbucket
You can’t perform that action at this time.