Skip to content

Instantly share code, notes, and snippets.

View shulard's full-sized avatar
🌍
Working from anywhere…

Stéphane HULARD shulard

🌍
Working from anywhere…
View GitHub Profile
@shulard
shulard / example.php
Last active January 12, 2018 04:15
WordPress: SQL Query to retrieve results when meta_key like `modules%_module` and meta_value as a given value...
<?php
global $wpdb;
$myid = 157;
$views = $wpdb->get_results($wpdb->prepare(
'SELECT p.ID
FROM `wp_posts` as p
LEFT JOIN `wp_postmeta` as m ON p.ID=m.post_id
WHERE m.meta_id IN (
SELECT meta_id FROM wp_postmeta
@shulard
shulard / .gitignore
Last active October 14, 2016 15:36
Melody script which help to identify who is current UserAgent in a webserver visit : http://melody.sensiolabs.org/
/vendor/
/ua-detector.phar
composer.lock
@shulard
shulard / hote.js
Created December 27, 2016 09:33
Utilisation de l'API window.postMessage pour communiquer avec une iFrame...
var callback = function(event) {
//Protection contre le hack, on n'autorise que les event venant de la frame cible
var origin = event.origin || event.originalEvent.origin;
if (origin !== 'http://domaine.de.ton.iframe.com') {
return;
}
if (event.data === 'tonmessage') {
//Ici tu peux déclencher ton tracker
}
@shulard
shulard / DynamicKernelResolution.php
Last active January 30, 2020 08:00
Define dynamic kernel for a specific test case !
<?php declare(strict_types=1);
namespace App\Tests\Features\SynchronousJob;
use App\Tests\Features\SynchronousTestCase;
use App\Tests\Features\SynchronousTestKernel;
class PushJobWithRetryOnTaskFailTest extends SynchronousTestCase
{
protected static function createKernel(array $options = [])