Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
This guy is on fire

Jérémy Levron 19h47

🔥
This guy is on fire
View GitHub Profile
@19h47
19h47 / exclude-posts-from-feed.php
Last active Nov 19, 2019
Exclude posts from WordPress feed
View exclude-posts-from-feed.php
<?php // phpcs:ignore
add_action( 'pre_get_posts', 'exclude_posts_from_feed' );
/**
* Exclude posts from feed
*
* Exclude posts from feed based on a boolean metadata (maybe set by an ACF
* field): exclude_from_feed
*
View Settings.php
<?php
/**
* Settings class
*/
/**
* Class Settings
*/
class Settings {
/**
@19h47
19h47 / CONNECT-SSH-IONOS.md
Last active Apr 6, 2019
Connect to IONOS shared hosting with SSH
View CONNECT-SSH-IONOS.md

In your terminal, enter the following command

ssh username@host

Then the terminal ask your password

username@host's password:
@19h47
19h47 / queries.sql
Last active Dec 10, 2019
SQL queries to change domain name on a WordPress site
View queries.sql
# 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
View getMousePositions.js
/**
* Get mouse position
*
* @param obj event
* @return obj { x, y }
* @see from http://www.quirksmode.org/js/events_properties.html#position
*/
export default function getMousePositions(event) {
let positionX = 0;
let positionY = 0;
@19h47
19h47 / index.php
Created Feb 16, 2018
WordPress navigation
View index.php
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$args = array(
'post_type' => 'post',
'posts_per_page' => 12,
'post_status' => 'publish',
'paged' => $paged,
);
@19h47
19h47 / Duration.js
Last active Feb 11, 2018
Okay JavaScript, you win. For now...
View Duration.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
</head>
<body>
<div class="js-form-duration">
<label for="">
@19h47
19h47 / fonts.scss
Last active Feb 7, 2018
Fonts placeholder and utility classes
View fonts.scss
/**
* Font
*
* A map containing all information about fonts
*
* @type map
*/
$font: (
/**
View Countdown.js
/**
* Countdown
*
* @see https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_countdown
*/
class Countdown {
/**
* Countdown.constructor
*/
constructor() {
@19h47
19h47 / Map.js
Last active Nov 3, 2017
Map class
View Map.js
// import $ from 'jquery';
/**
* Map
*/
class Map {
/**
* Map.constructor
*
You can’t perform that action at this time.