Skip to content

Instantly share code, notes, and snippets.

////////////////////////////////////////////////////////// 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);
////////////////////////////////////////////////////////// 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);
////////////////////////////////////////////////////////// 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 / bd0001.js
Last active December 13, 2017 19:55
////////////////////////////////////////////////////////// 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 / 0001.js
Last active December 13, 2017 17:31
// 0001
@yozzi
yozzi / profile
Created July 11, 2016 13:49
Fix Mac Terminal SSH Language
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 June 29, 2016 18:20
Rotate an image every 3 days
<?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 February 10, 2016 22:21
SOLVED! WORDPRESS ASKING FOR LOCAL FTP CREDENTIALS ON XAMPP
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 November 16, 2015 01:52
Function to change a plugin icon
//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 November 16, 2015 01:51
Rename admin menu with js
// 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 }
}