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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(200); |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.rotateCannon(180); | |
robot.ahead(100); |
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
// mauvaise syntaxe | |
<h1><?php _e('This is a <span class="red">title</span>', 'textdomain') ?></h1> | |
//Et ça, c'est mal ? | |
<?php echo sprintf( __( '%sThis is a %stitle%s', 'textdomain'),'<h1>', '<span class="red">', '</span></h1>' ); ?> |
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
// dequeue styles | |
add_filter( 'mca-load-styles', '__return_false' ); | |
// dont send notifications | |
add_filter( 'mca_send_email_on_mention', '__return_false' ); | |
// dont send notifications to user which already subscribe | |
add_filter( 'mca_filter_recipient','dont_send_user_who_already_subscribe', 100, 2 ); | |
function dont_send_user_who_already_subscribe( $recipients, $comment ) { | |
global $wpdb; |
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
#Compte-rendu de la KiwiParty | |
##CSS pour les livres numériques | |
##Ce que vous avez toujours voulu savoir sur CSS | |
##Y'a pas de pépins, que des solutions | |
##Accélérer ses pages web |
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
// je fais une requête ajax vers le lien, en poussant BAWXMLHttpRequest dans les headers | |
function perform_ajax_request( url ) { | |
$.ajax({ | |
url : url, | |
type : 'POST', | |
headers: { | |
'X-Requested-With':'BAWXMLHttpRequest' | |
} | |
}).done( function( data ) { | |
var data = $.parseJSON( data ); |
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
add_filter( 'template_include', 'baw_template_include' ); | |
function baw_template_include( $template ) { | |
if( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && $_SERVER['HTTP_X_REQUESTED_WITH']== 'BAWXMLHttpRequest' ): | |
$pre = dirname( $template ); | |
$suf = basename( $template ); | |
$_template = $pre . '/ajax-' . $suf; | |
if( !file_exists( $_template ) ) | |
$_template = $template; | |
$template = $_template; | |
endif; |
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
// j'écoute les clic de tous les liens, sauf de l'admin bar | |
$( document ).on( 'click', 'a[href^="http://www.example.com"]:not(.ab-item)', do_ajax_request ); | |
// lors d'un clic, j'exécute une fonction qui prend le lien en paramètre | |
function do_ajax_request( e ) { | |
e.preventDefault(); | |
var url = $( this ).attr( 'href' ); | |
perform_ajax_request( url ); | |
} |
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 | |
// code à insérer dans un fichier déposé à la racine de l'intallation | |
// regardez aussi s'il n'y a pas une image wordpress1.jpg, dans votre dossier uploads, à supprimer | |
// et bien sur changer tous les mots de passe après ^^ | |
// et même, c'est pas sur que cela soit suffisant | |
function rglob( $pattern = '*', $path = '', $flags = 0 ) { | |
$paths = glob( $path . '*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT); | |
$files = glob( $path . $pattern, $flags ); | |
foreach ( $paths as $path ) { |
OlderNewer