Skip to content

Instantly share code, notes, and snippets.

View mrsize's full-sized avatar

Thomas Dufranne mrsize

View GitHub Profile
@mrsize
mrsize / gist:56d3130b36c7ffd3278b0ad0e49491a6
Last active November 30, 2018 13:19
ubuntu command lines - Lignes de commandes pour Ubuntu
== Move files and directories to the parent folder in Linux ===
cd to/the/dir
mv * ../
== installer apapche ==
apt-get install apache2 apache2-doc
== Redemarrer apache apres changement des dns ==
@mrsize
mrsize / gist:d3226ba14e17f91ef9c1ff7dbe66d1a3
Created December 3, 2018 18:30
Youtube channel : Find the RSS Address
e.g. for the channel : https://www.youtube.com/channel/UC_4WpPcSfpxsSqA6hNpqJbg
the RSS link is : https://www.youtube.com/feeds/videos.xml?channel_id=UC_4WpPcSfpxsSqA6hNpqJbg
To find the id, you need to find the "externalId" in the page source code.
@mrsize
mrsize / wp-cf7-detect-spam-before-sending.php
Created December 4, 2018 13:32
WPCF7 Check spam before Sending email
<?php
// Untested : Detect spam before sending, in CF7 Plugin
// source : https://newburynew.media/contact-form-7-before-send-mail-example/
function wpcf7_register_user($wpcf7){
$formid = 1;
$submission = WPCF7_Submission::get_instance();
@mrsize
mrsize / wp-search-replace-function.php
Created December 6, 2018 16:12
WordPress Search & Replace in posts
<?php
/**
*
* Search & Replace in WordPress posts
*
*/
function mytheme_go_replace(){
@mrsize
mrsize / gist:d18a5b4a676e103b5372047c585830aa
Last active December 6, 2018 19:54
Some RSS Usefull links
// Diaspora* RSS Feed URL :
https://framasphere.org/public/USERNAME.atom
// Mastodon RSS Feed URL :
https://INSTANCE.COM/@USERNAME.atom
// Youtube Channel RSS Feed URL (with the externalId) :
https://www.youtube.com/feeds/videos.xml?channel_id=UC_4WpPcSfpxsSqA6hNpqJbg
@mrsize
mrsize / wp_minify_html_output.func.php
Last active January 27, 2020 13:04
Wordpress Minify HTML for visitors
/*
** Minifier le HTML :
*/
// Enable GZIP output compression
if(extension_loaded("zlib") && (ini_get("output_handler") != "ob_gzhandler"))
add_action('wp', create_function('', '@ob_end_clean();@ini_set("zlib.output_compression", 1);'));
// ob_start = mise en tampon
add_action('get_header', 'mytheme_html_minify_start');
@mrsize
mrsize / cf7_antispam_hide_honeypot_field.func.php
Created February 4, 2020 11:41
CF7 Antispam Hide Honeypot Field Function
function wp1561_cf7_antispam_hide_honeypot_field() {
global $post;
if( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'contact-form-7') ) {
echo "<style>.honeypotField{display:none;}</style>";
}
}
add_action( 'wp_head', 'wp1561_cf7_antispam_hide_honeypot_field' );
@mrsize
mrsize / css-transition-with-delay-in-js.html
Last active February 12, 2020 14:45
CSS Transition with Javascript (No jQuery)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Transition with Javascript (No jQuery)</title>
@mrsize
mrsize / wp_check_spam_email.php
Last active May 12, 2021 07:59
Antispam Wordpress CF7
<?php
/**
* Plugin Name: TD CF7 Antispam
* Plugin URI: https://www.mistersize.com/tag/spam/
* Description: Collection de solutions Antispam pour le plugin CF7 ( Modif du : 12 Mai. 2021 )
* Version: 1
* Author: Thomas Dufranne
* Author URI: http://mistersize.com
* License: GPL2
*/
@mrsize
mrsize / antispam.css
Created June 11, 2021 12:31
E-mail and Phone number antispam CSS
/* E-mail Antispam */
.arobase::before {
content: "\000040";
font-size: inherit !important;
}
.arobase span {
font-size: 1px;
font-size: 0.1px;
text-indent: -999px;