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
$('html, body').animate({ | |
'scrollTop': element.offset().top | |
}, 'slow', 'swing'); |
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
/* | |
Article : http://blog.goetter.fr/post/13447625254/un-reset-responsive-pour-les-images | |
Demo : http://ie7nomore.com/fun/responsive-images/ | |
*/ | |
img { /* <img alt="" src="youhou.jpg" width="680" height="454"> */ | |
max-width: 100%; | |
height: auto; width: auto; | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; |
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
/* | |
AVG, MAX, MIN on meta_value in WordPress | |
http://konstruktors.com/blog/wordpress/4554-avg-max-min-meta-value/ | |
*/ | |
SELECT | |
meta_key, | |
MAX(meta_value+0.0) max_meta | |
FROM |
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 | |
// http://speckyboy.com/2012/08/07/using-wordpress-to-create-a-micro-site-within-an-existing-theme | |
function magazine_post_type() { | |
register_post_type( 'magazine_', array( | |
'labels' => array( | |
'name' => __('Magazine Posts'), | |
'singular_name' => __('Magazine Edition'), | |
'add_new_item' => __('Create a New Edition' ) | |
), |
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
/* http://css-tricks.com/centering-in-the-unknown/ */ | |
/* This parent can be any width and height */ | |
.block { | |
text-align: center; | |
} | |
/* The ghost, nudged to maintain perfect centering */ | |
.block:before { | |
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
# export | |
mysqldump -u root -p --all-databases > all_dbs.sql | |
# import | |
mysql -u root -p < all_dbs.sql |
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
cd /folder | |
# To get a confirmation for every file use: | |
find . -type f -name "*.bak" -exec rm -i {} \; | |
#To just delete all of a file type without a confirmation use: | |
find . -type f -name "*.bak" -exec rm -f {} \; |
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
rsync -avz -e ssh [email protected]:/var/lib/rpm /root/temp |
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
server { | |
listen 80; | |
server_name website.loc www.website.loc; | |
access_log /var/log/nginx/website.access_log; | |
error_log /var/log/nginx/website.error_log; | |
root /home/web/website.loc/www/; | |
index index.php index.html index.htm; |
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
# tar a folder | |
tar -pczf web.tar.gz web/ | |
# untar | |
tar xvfz web.tar.gz | |
tar xfz web.tar |