Skip to content

Instantly share code, notes, and snippets.

@johnulist
johnulist / README.md
Created December 20, 2020 18:06 — forked from kerryboyko/README.md
VueJS Best Practices Guide

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@johnulist
johnulist / cheatsheet.md
Created November 20, 2020 10:26 — forked from rseon/cheatsheet.md
Prestashop cheatsheet (>= 1.5)

The most common. For me. Mostly from comments in source code.

Classes

Attribute

  • bool Attribute->cleanPositions(int $id_attribute_group) Reorder attribute position in group $id_attribute_group. Call it after deleting an attribute from a group.
  • int Attribute::getHigherPosition(int $id_attribute_group) Get the higher attribute position from a group attribute
  • bool AttributeGroup::cleanPositions() Reorder group attribute position. Call it after deleting a group attribute.

Configuration

@johnulist
johnulist / create_meta_product.php
Created September 21, 2020 19:32 — forked from anddimario/create_meta_product.php
Bulk creation of SEO meta title and description for Prestashop
<?php
// Info:
// http://doc.prestashop.com/pages/viewpage.action?pageId=51184692
// Used tables: ps_manufacturer, ps_category_lang, ps_product_lang, ps_product
// Run: php create_meta_product.php
// Clean:
// UPDATE ps_product_lang SET meta_title = "", meta_description="";
require(dirname(__FILE__).'/./config/config.inc.php');
@johnulist
johnulist / clear_cache_cron.php
Created September 21, 2020 19:31 — forked from SebSept/clear_cache_cron.php
Script pour vider le cache de prestashop 1.7
<?php declare(strict_types=1);
/**
* Script pour vider le cache de prestashop.
*
* Résoud le problème de lenteur lié a l'exces de ressource consommé par le vidage du cache.
* Script a placer à la racine de l'installation de prestashop.
*
* Fonctionnement
* 1 - création d'un dossier vide destiné a être le nouveau dossier de cache.
* 2 - renomage du dossier de cache actuel
<?php
$timer_start = microtime(true);
if (!defined('_PS_ADMIN_DIR_'))
define('_PS_ADMIN_DIR_', getcwd());
if (!defined('PS_ADMIN_DIR'))
define('PS_ADMIN_DIR', _PS_ADMIN_DIR_);
require(_PS_ADMIN_DIR_ . '/../config/config.inc.php');
require(_PS_ADMIN_DIR_ . '/functions.php');
@johnulist
johnulist / CommonController.php
Created September 21, 2020 19:29 — forked from caovillanueva/CommonController.php
[PS1.7 Pagination results in Backoffice does not working] Only for ver. 1.7.7.0 #PS17
Just replace the function paginationAction for this one in src/PrestaShopBundle/Controller/Admin/CommonController.php:
public function paginationAction(Request $request, $limit = 10, $offset = 0, $total = 0, $view = 'full', $prefix = '')
{
$offsetParam = empty($prefix) ? 'offset' : sprintf('%s[offset]', $prefix);
$limitParam = empty($prefix) ? 'limit' : sprintf('%s[limit]', $prefix);
$limit = max($limit, 10);
<?php
/**
* 2007-2019 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/OSL-3.0
@johnulist
johnulist / index.html
Created September 13, 2020 10:21
Simple CRUD with Vue.js
<div id="app">
<h4 class="head"> Application</h4>
<div class="container">
<!-- <div class="img-container">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAA1VBMVEX///9BuIM1SV4lsncQMUxCvoU0PVtBu4Q1R10+t4E1RV05tn80QVw0Q1w0P1s0tX3x+vef2b54y6Tp9/G24s3i9OxPvozD59bb8ObP7N6s3seGz65cwpSV1Lc/oHxIvIlwyJ87e283UWI8g3I6bWs+mHlBr4E5Zmg8iXR/zalAqX84W2VZwZI+nnuc17tBsoI+kXc3VmMlO1TH09Pl7ex3jZNIZXANNU2fsLMeRFYTO1A6dG0Aq2kOIEhsgooCKkixwMHX4OA0Mlkil25adH2JnKFegISv2nx/AAAHGElEQVR4nO2ba1vUOhRGyww4FxhmRAVUUMQLCio3ARG8HfH8/590HvGAVHabld3dNpkn67M2TTMm27XfZFkikUgkEolEIpFIJBKJRCKRSCQSiUQikVCwet5F/Pg86+TrsdfQx1/dj/z8g73e+WrxOG/mZwhzL4YdJ7OHHhM8nHU/cPhiDr3d/OOSgSZd9IyZ3TvuF+qfeszwtO9+4OIue7nupGykR2P0kLnnI/cbHXzEE/x44H7c6DlbwvGj8rHYZ5rpdcBHPyn9mDeYnLif1u/04Ls5BnvIfqe9l4vuGQ6/wBl+Af+sF1+yGXYfukbbgJvNDljE2e9ogt/BNtPfgdvMhnO4e3ARt8lms4NmSD7WnW24hPfc463DRTwjm803MMFvZJs5g0u4Tj7peIAeNrPgfrHOJzDeJ/CcBfZKgzGZYHafnRi912CKBz+dw/0ES7jwmv1Gx/fRDLNltohzm2Sz+eAY7APZZjbZb3SwzCaYrcLN5h05MS4cg12Qk+Id3GZKCtI
@johnulist
johnulist / mysqldump.php
Last active July 19, 2020 16:53 — forked from micc83/mysqldump.php
Simple PHP script to dump a MySql database
<?php
//Other solutions
/*
1- https://github.com/spatie/db-dumper
2- https://github.com/ifsnop/mysqldump-php
3-
*/
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);