Skip to content

Instantly share code, notes, and snippets.

View 19h47's full-sized avatar
🔥
This guy is on fire

Jérémy Levron 19h47

🔥
This guy is on fire
View GitHub Profile
@MarioRicalde
MarioRicalde / youtube-url-regexp.php
Last active February 18, 2021 06:32
YouTube URL PHP Regexp Shit
<?php
/**
* YouTube Preg Match Test Case.
*
* @author Mario "Kuroir" Ricalde
*/
// Regular Expression (the magic).
$youtube_regexp = "/^http:\/\/(?:www\.)?(?:youtube.com|youtu.be)\/(?:watch\?(?=.*v=([\w\-]+))(?:\S+)?|([\w\-]+))$/";
@lenivene
lenivene / functions.php
Last active September 3, 2021 12:52
Insert thumbnail (attachment) post by url
<?php
/**
* Insert thumbnail by URL
* Is very good to execute wp_insert_post
*
* @author Lenivene Bezerra
* @param string $url Image url external or no
* @param int $post_ID Post id to insert thumbnail
* @return ID Thumbnail | WP_Error
*/
@GregoireHebert
GregoireHebert / lissajous.html
Last active November 25, 2021 09:26
Table des courbes de Lissajous
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="Table de courbes de Lissajous">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Table de courbes de Lissajous</title>
<style type="text/css">
body { background-color: black; }
</style>
@Tam
Tam / Swipe-Example.js
Created June 2, 2016 09:38
Vanilla JavaScript Swipe Detection
new Swipe(document.getElementById("gallery"), function(event, direction) {
event.preventDefault();
switch (direction) {
case "up":
// Handle Swipe Up
break;
case "down":
// Handle Swipe Down
break;
<?php
add_action( 'wp_enqueue_scripts', function () {
wp_register_script( 'my-script', get_stylesheet_directory_uri() . '/assets/js/my-script.js' );
wp_enqueue_script( 'my-script' );
} );
add_filter( 'script_loader_tag', function ( $tag, $handle ) {
@azinasili
azinasili / px-to-em.scss
Last active August 1, 2023 22:14
Convert px values to em
// Functions and mixin to convert `px` values into `em` units
//
// px-to-em can easily be changed to `rem` values
// Change any instance of `em` to `rem`
//
// EXAMPLE:
// .foo {
// @include em(margin, 10px auto);
// padding: em(1px 2 3px 4);
// }
@zeshanshani
zeshanshani / acf_options_multilingual.php
Last active October 10, 2023 11:25
Creates separate Advanced Custom Fields options pages for the specified languages.
<?php // Don't copy this line if you are inserting in a file that has it already.
/**
* ACF Options Page
*
* Instructions:
* Add more languages to the array below: $languages
*
* @author: Zeshan Ahmed <https://zeshanahmed.com/>
*/
@Azgaar
Azgaar / .block
Last active November 22, 2023 14:26
Fantasy Map Generator
license: gpl-3.0
height: 570
border: no
@magicznyleszek
magicznyleszek / jekyll-and-liquid.md
Last active January 12, 2024 03:46
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes: