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
//Césure propre | |
function Cesure(){ | |
$content = strip_tags($mon_contenu); // cleaning input string | |
if (strlen($content) > 300) { | |
$contentCut = substr($content,0,300); | |
$content = substr($contentCut,0,strrpos($contentCut," "))." ..."; | |
} | |
return $content; | |
} |
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
#!/bin/bash | |
# | |
# m4a to ogg | |
# faad tool needs to be installed in your machine inorder to retrive metadata infos. | |
for i in *.m4a; do | |
tmp=$(mktemp) | |
y=`echo "$i"|sed -e 's/.m4a/.ogg/'` | |
faad -i "$i" 1>/dev/null 2>"$tmp" | |
if [ $? -ne 0 ] ; then |
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
# delete node | |
find . -name modules.xml | xargs xmlstarlet ed -L -d '//node' | |
# update attribute | |
find . -name modules.xml | xargs xmlstarlet ed -L -u '//node/@attr' -v 'value' | |
# indent with 4 spaces | |
for i in $(find . -name 'modules.xml'); do xmlstarlet fo -s 4 "$i" > "$i.tmp"; mv "$i.tmp" "$i"; done |
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
#!/bin/bash -e | |
clear | |
echo "============================================" | |
echo "WordPress Install Script" | |
echo "============================================" | |
echo "Do you need to setup new MySQL database? (y/n)" | |
read -e setupmysql | |
if [ "$setupmysql" == y ] ; then | |
echo "MySQL Admin User: " | |
read -e mysqluser |
NewerOlder