Skip to content

Instantly share code, notes, and snippets.

@AndreFSilveira
AndreFSilveira / remove_duplicate_toggle_checkbox.js
Created November 7, 2018 19:27
Remove duplicate toggle and checkbox with materialize. add this code before $.material.init();
...
$.material.togglebutton = function(selector) {
// Add fake-checkbox to material checkboxes
$((selector) ? selector : this.options.togglebuttonElements)
.filter(":notmdproc")
.filter(function(){ //added this filter to skip checkboxes that were already initialized
return $(this).parent().find(".toggle").length === 0;
})
.data("mdproc", true)
.after("<span class=toggle></span>");
@AndreFSilveira
AndreFSilveira / Imagemagick gem error
Created June 19, 2017 13:57
Para corrigir o erro do imagemagick no MAC
$ brew install imagemagick@6
$ echo 'export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile
$ PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install rmagick -v 2.13.4(Versão da gem que deve ser instalada)
@AndreFSilveira
AndreFSilveira / gist:86b2fc6c81acb77ea3a2fee926e44218
Created April 20, 2017 02:39 — forked from mgmilcher/gist:5eaed7714d031a12ed97
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

@AndreFSilveira
AndreFSilveira / # php56 - 2017-04-18_23-37-45.txt
Created April 19, 2017 02:55
php56 (homebrew/php/php56) on macOS 10.12.4 - Homebrew build logs
Homebrew build logs for homebrew/php/php56 on macOS 10.12.4
Build date: 2017-04-18 23:37:45
@AndreFSilveira
AndreFSilveira / confs
Created October 29, 2015 15:29
Detalhando as configurações do System.xml - Magento
label - it is label of the section displayed on the left side under the tab and on the right side as the page heading
sort_order – identifies the section position inside of the tab between the other sections
class – CSS class for section label in the tabs block (In PayPal module used for displaying of image instead of text)
header_css – CSS class used on section edit form (the page after clicking on the section label)
use_in_default - indicates that this section will be showed when “Default Values” is selected in “Current Configuration Scope”
use_in_website – indicates that this section will be showed when a website is selected in “Current Configuration Scope”
use_in_store – indicates that this section will be showed when a store view is selected in “Current Configuration Scope”
frontend_model – block class that is used as the section form render, by default used adminhtml/system_config_form
groups – contains definitions of groups those are described below
@AndreFSilveira
AndreFSilveira / Block Include Datapicker
Created October 29, 2015 15:11
Inserindo Datapicker no system.xml do Magento
<?php
//salve as ModuleName/Block/Adminhtml/System/Config/Dataphicker.php
class Module_Name_Block_Adminhtml_System_Config_Datapicker extends Mage_Adminhtml_Block_System_Config_Form_Field
{
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$date = new Varien_Data_Form_Element_Date;
$format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
$data = array(