This file contains hidden or 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
# SQL Methods to randomize and update Wordpress posts-dates at once | |
# ====================================== | |
# First method : | |
# ====================================== | |
SET @STARTDATE = "2021-01-01"; | |
SET @SETDATE = "2021-04-01 00:00:00"; | |
UPDATE `wp_posts` |
This file contains hidden or 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 | |
$log = file_get_contents('./src/logs/error-test.log'); | |
// Find all logs messages matching a pattern to process them, filter them out... | |
$exceptions = ['RecordNotFoundException', 'MissingRouteException', 'MissingActionException', 'MissingControllerException']; | |
$words = implode($exceptions, '\b|'); | |
$re = '/^.*(\b'.$words.'\b)\][\s\S]+?(?=\n\n)/m'; | |
preg_match_all($re, $log, $matches, PREG_SET_ORDER, 0); | |
// All found entries in $matches |
This file contains hidden or 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
/* Code from https://syllab.fr/projets/experiments/wutf/ */ | |
var placeholders = [ | |
"Hey ! What's up ?", | |
"Hello !?", | |
"Yop !", | |
"You're here ?", | |
"Got a second ?", | |
"I need you man", | |
"Plans for the week end ?", |
This file contains hidden or 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
const barba = require('@barba/core'); | |
const anime = require('animejs'); | |
const Home = require('./views/home'); | |
const WhoWeAre = require('./views/whoweare'); | |
class App { | |
init() { | |
barba.init({ | |
transitions: [{ |
This file contains hidden or 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
const map = new mapboxgl.Map({ | |
container: 'map', | |
style: 'mapbox://styles/****/********', | |
center: [-0.579180, 44.837788], | |
zoom: 12.0 | |
}); | |
map.on('load', function() { | |
// ==================================== |
This file contains hidden or 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
var spinner = document.querySelector('.spinner'); | |
var content = document.querySelector('.content'); | |
var refreshButton = document.querySelector('.refreshButton'); | |
function networkRequest() { | |
return new Promise((resolve, reject) => { | |
const requestTime = 200; // request duration (for simulation) => 200ms | |
setTimeout(resolve, requestTime, { payload: { 'foo': 'bar' } }); | |
}); |
This file contains hidden or 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
SET @database = "database_name"; | |
SET @old_prefix = "old_prefix_"; | |
SET @new_prefix = "new_prefix_"; | |
SELECT | |
concat( | |
"RENAME TABLE ", | |
TABLE_NAME, | |
" TO ", | |
replace(TABLE_NAME, @old_prefix, @new_prefix), |
This file contains hidden or 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
SELECT @i:=0; | |
UPDATE contacts SET position = @i:=@i+1 WHERE location_id=1 ORDER BY id; |
This file contains hidden or 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
<root> | |
<element>A</element> | |
<element>B</element> | |
</root> |
This file contains hidden or 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 linear interpolator for hexadecimal colors | |
* @param {String} a | |
* @param {String} b | |
* @param {Number} amount | |
* @example | |
* // returns #7F7F7F | |
* lerpColor('#000000', '#ffffff', 0.5) | |
* @returns {String} | |
*/ |
NewerOlder