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
;(function($){ | |
$.fn.scrollToTop = function(position){ | |
var $this = this, | |
targetY = position || 0, | |
initialY = $this.scrollTop(), | |
lastY = initialY, | |
delta = targetY - initialY, | |
speed = Math.min(1500, Math.min(2000, Math.abs(initialY-targetY))), | |
start, t, y, frame = window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || |
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 current php and enable php with passed version | |
function switch-php { | |
sudo a2dismod php$(php -v | grep -o -E '[0-9.]+' -m 1 | cut -c 1-3 | head -n 1); | |
sudo a2enmod php$1; | |
sudo update-alternatives --set php /usr/bin/php$1; | |
sudo update-alternatives --set phar /usr/bin/phar$1; | |
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$1; | |
sudo update-alternatives --set phpize /usr/bin/phpize$1; | |
sudo update-alternatives --set php-config /usr/bin/php-config$1; | |
sudo service apache2 restart; |