Skip to content

Instantly share code, notes, and snippets.

View federivo's full-sized avatar

Federico Rivollier federivo

View GitHub Profile
@federivo
federivo / gist:4060609
Created November 12, 2012 17:18 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@federivo
federivo / gist:5513090
Created May 3, 2013 19:23
Git: List all files modified between 2 commits
git diff-tree --no-commit-id --name-only -r <HASH1> <HASH2>
# Basic text search with relevancy for MongoDB.
# See http://blog.tty.nl/2010/02/08/simple-ranked-text-search-for-mongodb/
# Copythingie 2010 - Ward Bekker - ward@tty.nl
#create (or empty) a docs collection
doc_col = MongoMapper.connection.db('example_db').collection('docs')
doc_col.remove({})
#add some sample data
doc_col.insert({ "txt" => "it is what it is"})
class Mage_Paypal_Block_Standard_Redirect extends Mage_Core_Block_Abstract
{
protected function _toHtml()
{
$standard = Mage::getModel('paypal/standard');
$form = new Varien_Data_Form();
$form->setAction($standard->getConfig()->getPaypalUrl())
->setId('paypal_standard_checkout')
->setName('paypal_standard_checkout')
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@federivo
federivo / gist:e4f7d4936ef5ce21bf75
Created February 15, 2016 15:05
List all vagrant boxes running
VBoxManage list runningvms
@federivo
federivo / gist:ddca3d864fe473d40988
Last active February 24, 2016 12:52
Magento 2 CLI install
sudo ./magento setup:install --base-url=http://local.magento.com/ --db-host=localhost --db-name=dbname --db-user=root --db-password=passw --admin-firstname=First --admin-lastname=Last --admin-email=mail@mail.com --admin-user=admin --admin-password=admin --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1
@federivo
federivo / di.xml
Last active March 22, 2017 03:16
Gists for federivo.github.io/magento2/2016/02/19/commands-in-magento2.html
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Framework\Console\CommandList">
<arguments>
<argument name="commands" xsi:type="array">
<item name="exportCustomersCommand" xsi:type="object">Federivo\CustomerExport\Command\ExportCustomerCommand</item>
</argument>
</arguments>
</type>
</config>
@federivo
federivo / gist:3fad910cdb948aee310375c5ca10afd0
Created November 21, 2016 12:59
PHPBrew install php 7 with variants
phpbrew install 7.0 +default+mysql+pdo+debug+apxs2+opcache+mcrypt+mhash+phar
@federivo
federivo / ExportCustomerCommand.php
Last active March 23, 2017 00:18
Gists for federivo.github.io/magento2/2016/02/19/commands-in-magento2.html
<?php
namespace Federivo\CustomerExport\Command;
use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Framework\Api\SearchCriteriaBuilder;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\File\Csv;
use Magento\Framework\Filesystem\Driver\File;
use Symfony\Component\Console\Command\Command;