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
find . -type f -exec ls -s {} \; | sort -n -r | head -10 |
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
find . -not -perm 755 -type f -exec chmod 755 {} \; |
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
// Works in modern browsers + IE9, but Modernizr has a polyfill baked in for function.bind. | |
// Hat tip Paul Irish | |
var o = $( {} ); | |
$.subscribe = o.on.bind(o); | |
$.unsubscribe = o.off.bind(o); | |
$.publish = o.trigger.bind(o); | |
// Usage | |
$(document.body).on( 'click', function() { |
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
# undo commit and REVERT the files to the last HEAD | |
git reset --hard HEAD~1 | |
# undo commit but PRESERVE the files before the last commit | |
git reset HEAD~1 |
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
(?<=start)(.*)(?=end) // lazy - it will select until LAST occurence | |
(?<=start)(.*?)(?=end) // not lazy - it will select until FIRST occurence |
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
# download stable Drupal | |
drush dl drupal | |
# install Drupal site with admin/admin acc | |
sudo drush site-install standard --account-name=admin --account-pass=admin --db-url=mysql://drupal7:drupal7@localhost/drupal7 | |
# clear drupal cache | |
drush cc | |
# download and enable module |
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
# redirects for url params | |
RewriteEngine On | |
RewriteRule ^([a-zA-Z0-9-z\-\_]+)$ index.php?page=$1 | |
RewriteRule ^([a-zA-Z0-9-z\-\_]+)/$ index.php?page=$1 | |
RewriteRule ^([a-zA-Z0-9-z\-\_]+)/([a-zA-Z0-9-z\-\_]+)$ index.php?page=$1&subpage=$2 | |
RewriteRule ^([a-zA-Z0-9-z\-\_]+)/([a-zA-Z0-9-z\-\_]+)/$ index.php?page=$1&subpage=$2 | |
# index file priority | |
DirectoryIndex index.html index.htm index.php welcome.html |
NewerOlder