Table of Contents
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 | |
public function findByRole(Role $role): mixed | |
{ | |
$rsm = $this->createResultSetMappingBuilder('u'); | |
$query = <<<SQL | |
SELECT %s | |
FROM user u | |
WHERE u.roles::jsonb ?? :role |
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 | |
/** | |
* Settings class | |
*/ | |
/** | |
* Class Settings | |
*/ | |
class Settings { | |
/** |
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
# see https://sql.sh/988-requetes-migrer-wordpress | |
# Change the URL of the site | |
UPDATE wp_options | |
SET option_value = replace(option_value, 'http://localhost:8888/site', 'http://www.site.fr') | |
WHERE option_name = 'home' | |
OR option_name = 'siteurl'; | |
# Change GUID URL | |
UPDATE wp_posts |
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 | |
************ Debug, Debuging ************ | |
//Activate log files in wp-config.php | |
define( 'WP_DEBUG', true ); // Enabling WP_DEBUG will cause all PHP errors, notices and warnings to be displayed. | |
define( 'WP_DEBUG_LOG', true ); // Enable Debug logging to the /wp-content/debug.log file | |
define( 'WP_DEBUG_DISPLAY', true ); // Controls whether debug messages are shown inside the HTML of pages or not. | |
// use this | |
define( 'WP_DEBUG', true ); | |
define( 'WP_DEBUG_LOG', true ); |
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
<notification> | |
<div id="snackbar"></div> | |
<script> | |
/* USAGE: | |
create an observable: | |
var globalEvents = riot.observable(); | |
And pull the trigger anywhere you need to: | |
globalEvents.trigger('notif_trigger', "Action done successfully"); | |
*/ | |
globalEvents.on('notif_trigger', function(data){ |
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
// Originally, I was using Redux to contain the state, but switched to RiotControl | |
// because of its simplicity, and how it makes use of Riot's observable API. | |
// An issue I found with RiotControl was that, when you register multiple | |
// stores, it will call 1 event 1 time per store. So if you have 6 stores, | |
// `RiotControl.trigger('my-event')` will run 6 times. This is incredibly | |
// inefficient, especially if your app is doing a lot at once. | |
// After careful consideration, I failed to see the benefit of using | |
// RiotControl and instead opted for using the native Riot observable API. |
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
<div id="myCarousel" class="carousel slide" data-ride="carousel"> | |
<!-- Indicators --> | |
<ol class="carousel-indicators"> | |
<li data-target="#myCarousel" data-slide-to="0" class="active"></li> | |
<li data-target="#myCarousel" data-slide-to="1"></li> | |
<li data-target="#myCarousel" data-slide-to="2"></li> | |
</ol> | |
<div class="carousel-inner" role="listbox"> | |
<?php query_posts( 'meta_key=slide&showposts=3' ); ?> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> |
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
<!--HTML--> | |
<div class='images' id='image1'> | |
<div class='layer'></div> | |
<img src='images/picture.jpg' alt="" width="200" height="200" border="0" /> | |
</div> | |
<div class='images' id='image2'> | |
<div class='layer'></div> | |
<img src='images/picture.jpg' alt="" width="200" height="200" border="0" /> | |
</div> | |
<div class='images' id='image3'> |
This has been incorporated in a small library.
NewerOlder