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
/** | |
* Mobile Browser Detection for jQuery | |
* | |
* jQuery.browser.mobile will be true if the browser is a mobile device. | |
*/ | |
(function(a){jQuery.browser.mobile=/android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|meego.+mobile|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(2 |
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
/** | |
* Debug helper similar to PHP's print_r(). | |
* | |
* This function was inspired by the print_r function of PHP. | |
* This will accept some data as the argument and return a | |
* text that will be a more readable version of the | |
* array/hash/object that is given. | |
* | |
* @param data | |
* array, object or hash (assoc array) |
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
# k: Kilobyte, M: Megabyte, G: Gigabyte | |
# +: Bigger than, -: Lower than | |
find . -maxdepth 1 -type f -size +500k -exec rm -f {} \; | |
# Or better: | |
find . -maxdepth 1 -type f -size +50M -delete | |
# Let's have a look first: | |
find . -maxdepth 1 -type f -size +2G -exec ls -lhS {} \; | awk {print $5 "\t" $9} |
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
# Observe the mess, exclude the unnecessary | |
# | |
# -r: Recursive | |
# -I: Skip binaries | |
# | |
grep -rI --color "return base64_decode(\\$.*);" /path/to/www/root | |
# Clean the mess | |
# | |
# -r: Recursice |
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
# Try svn info and replace SVN_REPO_REMOTE_ADDRESS | |
svn propset --revprop -r {REVISION_NUMBER} --force "svn:log" "NEW_COMMIT_MESSAGE_HERE..." SVN_REPO_REMOTE_ADDRESS |
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
# Sorts the file by duplicate line count | |
sort /path/to/filename | uniq -c | sort -nr > ./_aggregated.tmp | |
# Just read the head as it's probably a huge file | |
head -n 1000 ./_aggregated.tmp | less |
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
( ) /\ _ ( | |
\ | ( \ ( \.( ) _____ | |
\ \ \ ` ` ) \ ( ___ / _ \ | |
(_` \+ . x ( .\ \/ \____-----------/ (o) \_ | |
- .- \+ ; ( O \____ | |
(__ +- .( -'.- <. \_____________ ` \ / | |
(_____ ._._: <_ - <- _- _ VVVVVVV VV V\ \/ | |
. /./.+- . .- / +-- - . (--_AAAAAAA__A_/ | | |
(__ ' /x / x _/ ( \______________//_ \_______ | |
, x / ( ' . / . / \___' \ / |
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 . -type f -name "__MACOSX" -exec rm -rf {} \; |
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
# When does cron.daily, cron.hourly, etc. run on a system? | |
grep run-parts /etc/crontab |
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 . -type f ! -regex ".*\/\.svn\/.*" -exec dos2unix {} \; |
OlderNewer