Skip to content

Instantly share code, notes, and snippets.

@victordit
victordit / sylius_delete_customers_and_orders.sql
Last active December 19, 2017 13:21
Delete all fake data (orders and customers) via sql query | Sylius 1.0.4
--
-- Delete all fake data via mysql query
-- Sylius 1.0.4
--
-- Disable foreign key chek
SET FOREIGN_KEY_CHECKS=0;
-- Delete Orders
TRUNCATE `sylius_adjustment`;
#!/bin/bash
#config
sites_available="/etc/apache2/sites-available/"
sites_enabled="/etc/apache2/sites-enabled/"
site_default="000-default.conf"
domain_default="localhost"
path_default="/var/www/html"
hosts="/etc/hosts"
local_ip="127.0.0.1"
@victordit
victordit / gist:3e41c634721874574134ce050f37d40f
Created November 17, 2017 18:25 — forked from Steven-Rose/gist:3943830
VI: Select all + delete, select all + copy
Select all and delete (actually move to buffer)
:%d
Select all and copy to buffer
:%y
Use p to paste the buffer.
@victordit
victordit / switch-php.sh
Created October 25, 2017 14:46
Script to switch version of php on fly in development enviroment
#!/bin/bash
###
#
# Script to switch version of php on fly in development enviroment
# Inspired by https://www.tecmint.com/install-different-php-versions-in-ubuntu/
# *REQUIRED sudo privileges
###
vd="PHP Version => "
function zerofill(length,number){
return new Array(length - number.toString().length + 1).join('0') + number;
}
<?php
/**
* @return void
* @param $var The variable passed
* @param string $label
* @param integer limit The limit for each
* @param string $path
*/
public function log($var,$label=null,$limit =2,$path = null)
{
<?php
/**
* @return void
* @param $var The variable passed
* @param string $module The name of module
* @param integer limit The limit for each
*/
public function log($var,$module,$limit =2)
{
<?php
/**
* @return string
* @param string $url
* @param array $params
*/
public function removeQueryString($url,$params=array())
{
if(count($params)){
foreach ($params as $value) {
# Magento exclude core
.htaccess.sample
.modgit/
.modman/
app/code/community/Phoenix/Moneybookers/
app/code/community/Cm/RedisSession/
app/code/core/
app/design/adminhtml/default/default/
app/design/frontend/base/
app/design/frontend/rwd/