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
#!/bin/bash | |
while read oldrev newrev refname | |
do | |
branch=$(git rev-parse --symbolic --abbrev-ref $refname) | |
if [ "master" == "$branch" ]; then | |
git --work-tree=/var/www/domain.com --git-dir=/home/git/repositories/root/testproject.git checkout -f | |
fi | |
done |
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 | |
/* | |
___ __ _ __ | |
/ | / /_____ ____ ___ (_______________ ___ ____ ______/ /_ | |
/ /| |/ __/ __ \/ __ `__ \/ / ___/ ___/ __ `__ \/ __ `/ ___/ __ \ | |
/ ___ / /_/ /_/ / / / / / / / /__(__ / / / / / / /_/ (__ / / / / | |
/_/ |_\__/\____/_/ /_/ /_/_/\___/____/_/ /_/ /_/\__,_/____/_/ /_/ | |
Wordpress XML importer - with Advanced Custom Fields Support | |
*/ |
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
find . -depth -name '* *' \ | |
| while IFS= read -r f ; do mv -i "$f" "$(dirname "$f")/$(basename "$f"|tr ' ' _)" ; done |
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
#!/bin/bash | |
#get folder name | |
echo "Enter the root folder name of Wordpress" | |
read name | |
#Get the database details from wp-config file | |
WPDBNAME=`cat ~/Sites/$name/wp-config.php | grep DB_NAME | cut -d \' -f 4` |
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
@include font-face('Name', font-files( | |
"filename.woff", woff, | |
"filename.ttf", truetype, | |
"filename.svg", svg), | |
$weight:normal, | |
$style:normal); |
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
//disable password nag | |
function stop_password_nag( $val ){ | |
return 0; | |
} | |
add_filter( 'get_user_option_default_password_nag' ,'stop_password_nag' , 10 ); |
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
sudo /Applications/MAMP/Library/bin/mysql -u root -p DATABASE < /SQL/backup.sql |
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
sudo /Applications/MAMP/Library/bin/mysqldump -u root -p DATABASE > /SQL/backup.sql |
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
//Get transient value. If it's expired it will return jolly sod all... | |
$teat = get_transient( 'cool_cache_name'); | |
//See what's in the variable | |
if($teat == ""){ | |
//Add the current time as a new transient, good value for testing. | |
//300 is equal to 5 minute - 60*60*12 is 12 hours | |
set_transient( 'cool_cache_name', date('G:i'), 300 ); | |
echo(date('G:i')); | |
}else{ |
NewerOlder