View Lazy load Disqus comments.js
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
/* | |
* http://christian-fei.com/tutorials/how-to-lazy-load-disqus-comments/ | |
* | |
* <div class="comments"></div> | |
*/ | |
var comments = document.getElementsByClassName('comments')[0], | |
disqusLoaded = false; | |
function loadDisqus() { |
View ubuntu-lamp-laravel-setup.sh
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
# Run with the following: | |
# curl -s https://gist.githubusercontent.com/samdoidge/55e4d3332448cc7f2f9a2cbe1124c247/raw/7c434cabc84a550dbdb95f2fa4c6ce129e70475a/ubuntu-lamp-laravel-setup.sh | bash -s 1g | |
# Last argument is swapfile size. 1g = 1 gigabyte. | |
set -e | |
sudo fallocate -l $1 /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab |
View recursively-cut-files.sh
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
for file in *; do head -n 11 "$file" > ../Test/"$file"; done |
View gist:2912c4b4e8690e79097f
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
check permissions on folder - chown'ing to plesk user |
View gist:fb880394887490b7ea4d
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
run | |
sudo updated | |
to fix |
View gist:0594a8429d2ded5094f2
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^www.samdoidge.com$ [NC] | |
RewriteRule ^(.*)$ http://samdoidge.com/$1 [R=301,L] | |
</IfModule> |
View content
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
rsync -avzr --exclude=.svn /dir/ /dir-copy/ |
View grep-exclude-file-extension
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
grep -r --exclude '*.sql' 'search string' . |
View grep-file-extension
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
grep -r --include="*.php" "search string" . |