This file contains 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 | |
/** | |
* Change the main query in order to hide posts from certain categories. | |
* | |
* @see https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts | |
*/ | |
function my_customized_query( $query ) { | |
if ( $query->is_home() && $query->is_main_query() ) { | |
$query->set( 'cat', '-10,-11,-325' ); | |
} |
This file contains 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
jQuery(document).ready(function($){ | |
$(".pis-thumbnail-link").attr('rel','bookmark nofollow'); | |
}); |
This file contains 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 | |
function add_no_follow() { | |
wp_register_script( 'addnofollow', get_template_directory_uri() . '/js/google_no_translate.js', array( 'jquery' ), false, true ); | |
wp_enqueue_script( 'addnofollow' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'add_no_follow' ); |
This file contains 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 | |
$a = 0; | |
$s = 0; | |
$ciclo = 0; | |
while ($a < 500) { | |
$a = $a + 8; | |
echo 'Multiplo di 8 = ' . $a . "<br>"; | |
$s = $s + $a; | |
echo 'Somma dei multipli di 8 = ' . $s . "<br>"; | |
$ciclo = $ciclo + 1; |
This file contains 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
#!/usr/bin/python | |
import re | |
import subprocess | |
import os | |
DEVICES = [ | |
('0x1050', '0x0111', 'Yubico Yubikey NEO OTP+CCID'), | |
('0x1050', '0x0112', 'Yubico Yubikey NEO CCID'), | |
('0x1050', '0x0115', 'Yubico Yubikey NEO U2F+CCID'), |
This file contains 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 | |
/* *** SITUATION *** | |
* We want to retrieve 3 posts and show the sticky posts on top. | |
* To make sticky posts work as expected, the 's' parameter must be not declared or should be NULL, | |
* otherwise the sticky posts won't appear on top of other posts. | |
*/ | |
/* *** CASE 1 *** | |
* This code works as expected ('s' is not declared) and sticky posts appear on top: | |
*/ |
This file contains 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 | |
/** | |
* Load the Javascript file. | |
* The file will be loaded only in the widgets admin page. | |
* | |
* @since 1.25 | |
*/ | |
function pis_load_scripts( $hook ) { | |
if( $hook != 'widgets.php' ) { | |
return; |
This file contains 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
avconv -i input.MTS -s 1280x720 -b 8000k -r 30 output.mp4 |
This file contains 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 | |
function toto_rename( $action ) { | |
switch ( $action ) : | |
case 'home' : | |
$directory = '/'; | |
break; | |
case 'it' : |
This file contains 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
/* | |
Theme Name: {Child Theme name} | |
Theme URI: http: //www.example.com | |
Description: Child theme for {Parent theme name} | |
Author: {Author} | |
Author URI: http://www.example.com | |
Template: {name of the folder of the parent theme | |
Version: {version number} | |
*/ |