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 | |
/** | |
* @version 1.0.0 | |
* @package Readmedia | |
* @copyright Copyright (C) 2018 David Jardin - djumla GmbH | |
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> | |
* @link http://www.djumla.de | |
*/ | |
/* Initialize Joomla framework */ |
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
-- A upgrade from 3 to 4 (or copy manually the content table) was not completed successfuly | |
-- as it should have created a record for each article in the #_workflow_associations table. (even if you are not using workflows it needs a record in that table). | |
-- Newly created articles in j4 or higher have that record created automatically. | |
-- The sql query below should create the missing records for you. | |
-- | |
-- replace #_ with your own db prefix | |
INSERT INTO #__workflow_associations (item_id, stage_id, extension) | |
SELECT c.id as item_id, '1', 'com_content.article' FROM #__content AS c | |
WHERE NOT EXISTS (SELECT wa.item_id FROM #__workflow_associations AS wa WHERE wa.item_id = c.id); |
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
function getEvenOddCounts (acc, val) { | |
const key = val % 2 === 0 ? "even" : "odd"; | |
acc[key] = (acc[key] ?? 0) + 1; | |
return acc; | |
} | |
const result = [1, 2, 3, 4, 5].reduce(getEvenOddCounts, {}); | |
console.log(result); // { even: 2, odd: 3 } |
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
// type.ts | |
enum Ingredient { | |
salad = "salad", | |
bacon = "bacon", | |
cheese = "cheese", | |
meat = "meat", | |
breadBottom = "bread-bottom", | |
breadTop = "bread-top", | |
} |
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
// AUX FILE | |
import React from "react"; | |
interface AuxProps { | |
children: React.ReactNode; | |
} | |
const aux = (props: AuxProps) => <>{props.children}</>; | |
export default aux; |
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
$pattern = '#<hr\s+id=("|\')system-readmore("|\')\s*\/*>#i'; | |
$tagPos = preg_match($pattern, $someText); | |
if ($tagPos == 0) | |
{ | |
$introText = $someText; | |
$fullText = ''; | |
} | |
else | |
{ |