This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example of retrieving the {data install scheme dir} and {scripts install scheme dir} paths | |
import sysconfig | |
data_path = sysconfig.get_path('data') | |
scripts_path = sysconfig.get_path('scripts') | |
# now you can construct the full paths to the stuff you need inside those directories... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#run file | |
version: '3.2' | |
services: | |
app: | |
image: YOUR_APP_IMAGE_URL_HERE | |
restart: unless-stopped | |
environment: | |
TTRSS_DB_HOST | |
TTRSS_DB_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
CREATE FUNCTION WORKDAYSDATEDIFF (date1 DATE, date2 DATE, workdays VARCHAR(7)) | |
RETURNS INT DETERMINISTIC | |
/* Calculates working days between 2 dates, work days are supplied as a string with numbers from 0-6 corresponding to WEEKDAY, for example Mon-Fri would be '01234' */ | |
BEGIN | |
DECLARE date_start DATE; | |
DECLARE date_end DATE; | |
DECLARE total_days INT; | |
DECLARE weeks INT; | |
DECLARE start_weekday INT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Proof of concept of Prestashop Github Issue 14041 https://github.com/PrestaShop/PrestaShop/issues/14041 | |
* Put this code inside modules/issue14041/issue14041.php and install the module, it will replicate the issue any time the module's configuration is accessed. | |
*/ | |
class Issue14041 extends Module | |
{ | |
public function __construct() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AdminThemesController extends AdminThemesControllerCore | |
{ | |
public function init() | |
{ | |
$this->logged_on_addons = false; | |
parent::init(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sections = Section::model()->findAll( | |
array('order'=>'parent ASC NULLS FIRST,"order"')); //PostgreSQL FTW | |
$entryRecords = array(); | |
$entryPaths = array(); | |
foreach ($sections as $section) { | |
$section->children = array(); | |
$entryPaths[$section->id] = array(); | |
if ($section->parent === NULL) { | |
$entryRecords[$section->order] = $section; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$entries = yourGetEntriesFromDbFunction(); //The array with our retrieved DB entries | |
$entryRecords = array(); //Our hierarchy will be created in this array | |
//We will track the path of each entry here, with an array | |
//for each entry containing the ids of all its ancestors: | |
$entryPaths = array(); | |
foreach ($entries as $entry) { | |
//Create a new key inside each entry to store its children: | |
$entry['children'] = array(); | |
$entryPaths[$entry['id']] = array(); //Make a space for the path of the entry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof jQuery.fn.prop != 'function') { | |
jQuery.fn.prop = jQuery.fn.attr; | |
} |