Skip to content

Instantly share code, notes, and snippets.

View bd0004.js
////////////////////////////////////////////////////////// Step 1 //////////////////////////////////////////////////////////
jQuery( document ).ready(function() {
// On remplace des textes
var replaced = jQuery("body").html().replace(/Nombre de Adultes/g, 'Nombre d\'adultes');
jQuery("body").html(replaced);
var replaced = jQuery("body").html().replace(/Nombre de Enfants/g, 'Nombre d\'enfants');
jQuery("body").html(replaced);
View bd0003.js
////////////////////////////////////////////////////////// Step 1 //////////////////////////////////////////////////////////
jQuery( document ).ready(function() {
// On remplace des textes
var replaced = jQuery("body").html().replace(/Nombre de Adultes/g, 'Nombre d\'adultes');
jQuery("body").html(replaced);
var replaced = jQuery("body").html().replace(/Nombre de Enfants/g, 'Nombre d\'enfants');
jQuery("body").html(replaced);
View bd0002.js
////////////////////////////////////////////////////////// Step 1 //////////////////////////////////////////////////////////
jQuery( document ).ready(function() {
// On remplace des textes
var replaced = jQuery("body").html().replace(/Nombre de Adultes/g, 'Nombre d\'adultes');
jQuery("body").html(replaced);
var replaced = jQuery("body").html().replace(/Nombre de Enfants/g, 'Nombre d\'enfants');
jQuery("body").html(replaced);
View bd0001.js
////////////////////////////////////////////////////////// Step 1 //////////////////////////////////////////////////////////
jQuery( document ).ready(function() {
// On remplace des textes
var replaced = jQuery("body").html().replace(/Nombre de Adultes/g, 'Nombre d\'adultes');
jQuery("body").html(replaced);
var replaced = jQuery("body").html().replace(/Nombre de Enfants/g, 'Nombre d\'enfants');
jQuery("body").html(replaced);
@yozzi
yozzi / profile
Created Jul 11, 2016
Fix Mac Terminal SSH Language
View profile
I then edited /etc/profile and added these two lines:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
@yozzi
yozzi / rotate.php
Created Jun 29, 2016
Rotate an image every 3 days
View rotate.php
<?php
date_default_timezone_set('America/New_York');
$dayOfTheYear = date('z');
$iterationCount = ceil($dayOfTheYear / 3);
$numberForIteration = $iterationCount % 8;
echo '<img alt="" src="'.$numberForIteration.'.jpg" />';
@yozzi
yozzi / solved.txt
Created Feb 10, 2016
SOLVED! WORDPRESS ASKING FOR LOCAL FTP CREDENTIALS ON XAMPP
View solved.txt
SOLVED! WORDPRESS ASKING FOR LOCAL FTP CREDENTIALS ON XAMPP
A few developers were asking why their localhost instances of WordPress were asking for FTP credentials when trying to install new plugins and themes. If you’re getting the dreaded “Please enter your FTP credentials” page and you’re running XAMPP for your local WP development environment, do not follow the popular StackOverflow answer that tells you to chown your wordpress folder to _www. Read more for the real fix.
There’s a Stackoverflow page that tells you to chown your local environment to www, but according to the <a href=“http://www.apachefriends.org/en/xampp-macosx.html” target=“blank”>recent XAMPP documentation, Apache is running as user ‘daemon.’
So the fix is to go into your Terminal and cd to your local directory. If you develop a lot of wordpress stuff at the same time, you can just chown your htdocs directory (remember that you should never use XAMPP as a production environment, which means you should never follow these ideas for live
@yozzi
yozzi / functions.php
Created Nov 16, 2015
Function to change a plugin icon
View functions.php
//Modify Timeline CPT
function wpse_65075_modify_timeline_menu_icon( $post_type, $args ) {
// Make sure we're only editing the post type we want
if ( 'te_announcements' != $post_type )
return;
// //Get labels and update them
// $labels = get_post_type_labels( get_post_type_object( $post_type ) );
// $labels->name = 'Some things';
// $labels->singular_name= 'Some thing';
@yozzi
yozzi / function.php
Created Nov 16, 2015
Rename admin menu with js
View function.php
// renommer Timeline Express en Timeline dans le menu
function startup_reloaded_timeline_js() {
if ( is_plugin_active('timeline-express/timeline-express.php')) { ?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#menu-posts-te_announcements .wp-menu-name").html("Timeline");
});
</script>
<?php }
}