Skip to content

Instantly share code, notes, and snippets.

@Onasusweb
Onasusweb / cheatsheet.md
Created November 20, 2020 10:17 — 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

$ git remote rm origin
$ git remote add origin [email protected]:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@Onasusweb
Onasusweb / bootstrap-component.css
Created June 2, 2016 14:55
Bootstrap 3.x left and right tabs
/* custom inclusion of right, left and below tabs */
.tabs-below > .nav-tabs,
.tabs-right > .nav-tabs,
.tabs-left > .nav-tabs {
border-bottom: 0;
}
.tab-content > .tab-pane,
.pill-content > .pill-pane {
@Onasusweb
Onasusweb / ImageExtractor.java
Created May 30, 2016 12:22 — forked from Daenyth/ImageExtractor.java
Java class to extract an image from an html page using a method similar to Google+'s
import java.io.IOException;
import java.net.URL;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
/**
* Given a url to a web page, extract a suitable image from that page. This will
* attempt to follow a method similar to Google+, as described <a href=
@Onasusweb
Onasusweb / Extract Url Meta data
Created May 30, 2016 12:22 — forked from Winston1029/Extract Url Meta data
Extract URL Meta data with Jsoup.
Long start = System.currentTimeMillis();
try {
Long start1 = System.currentTimeMillis();
Document doc = Jsoup.connect("http://techcrunch.com/2013/04/13/backed-or-whacked-join-together-with-the-band/").get();
Long end1 = System.currentTimeMillis();
Log.i(TAG, "CCCCC: connect" + (end1 - start1));
start1 = System.currentTimeMillis();
Elements links = doc.head().getElementsByAttribute("property"); //.getElementsByTag("meta");
end1 = System.currentTimeMillis();
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>How to parse a JSON String</title>
<!-- Load json2.js to support really old browsers -->
<script src="js/json2.js"></script>
</head>
@Onasusweb
Onasusweb / handlebar.js
Created May 1, 2016 17:26
How to combine JSON with Handlebars.js
/*
Copyright (C) 2011 by Yehuda Katz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@Onasusweb
Onasusweb / MySQL.php
Last active August 29, 2015 14:13 — forked from dmalykh/MySQL.php
<?php
class MySQL extends Db {
public $logRoute;
private $_cache_list;
private $_tables;
private $_enableFileCache = false;
private $_not_cached = array(
"cart"
);
<?php
require_once _PS_MODULE_DIR_ . 'sfadvancedmailer/models/Client.php';
/**
*
* @author Christophe Willemsen
*/
class SfAdvancedMailer extends Module {
<?php
if (!defined('_PS_VERSION_')) exit;
class TD_Shortcode extends Module {
protected static $initialized = false;
public function __construct() {
$this->name = 'td_shortcode';
$this->tab = 'front_office_feature';