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 d -exec chmod 0755 {} \; | |
| find . -type f -exec chmod 0644 {} \; |
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
| <style> | |
| .embed-container { | |
| position: relative; | |
| padding-bottom: 56.25%; | |
| padding-top: 30px; | |
| overflow: hidden; | |
| max-width: 100%; | |
| height: auto; | |
| } | |
| .embed-container iframe, |
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 | |
| /** | |
| * Convert a human-readable string into a slug | |
| * | |
| * 'Sample input string!' gets converted to 'sample-input-string' | |
| * | |
| * @param string Source string | |
| * @return string Slug | |
| * @author Cake Development Corporation (http://cakedc.com) |
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
| /** | |
| * Convert any string into an integer | |
| * | |
| * @param {string} str Input string | |
| * @return {integer} Integer | |
| */ | |
| var strToInt = (function () { | |
| var map = {}; | |
| var size = 0; | |
| var hash; |
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
| sips --matchTo /System/Library/ColorSync/Profiles/Generic\ RGB\ Profile.icc *.jpg |
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 a remote directory locally | |
| rsync -zatPe ssh --exclude uploads --exclude files username@example.com:/home/username/path/to/directory/ ~/local/path/to/directory/ | |
| # Copy a local directory without removing new files | |
| rsync -zatP /path/to/old/ /path/to/new/ | |
| # Copy just one file | |
| scp username@example.com:/home/username/path/to/file.txt ~/local/path/to/file.txt |
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
| # ---------------------------------------------------------------------- | |
| # Add trailing slash to (non-file) URLs | |
| # Rewrite "example.com/foo -> example.com/foo/" | |
| # ---------------------------------------------------------------------- | |
| <IfModule mod_rewrite.c> | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$ | |
| RewriteRule ^(.*)$ /$1/ [R=301,L] | |
| </IfModule> |
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
Show hidden characters
| { | |
| "disallowEmptyBlocks": true, | |
| "disallowKeywords": ["with"], | |
| "disallowMixedSpacesAndTabs": "smart", | |
| "disallowMixedSpacesAndTabs": true, | |
| "disallowMultipleLineStrings": true, | |
| "disallowQuotedKeysInObjects": "allButReserved", | |
| "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], | |
| "disallowSpaceBeforeBinaryOperators": [","], | |
| "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], |
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
| #!/bin/bash | |
| PATH=/usr/sbin:/usr/bin:/sbin:/bin | |
| if [[ $(service mysql status | grep running | wc -l) != 1 ]]; | |
| then | |
| echo "$(date "+%Y-%m-%d %T")" >> /root/keep-mysql-running.log | |
| echo "$(service mysql status)" >> /root/keep-mysql-running.log | |
| service mysql start >> /root/keep-mysql-running.log | |
| fi |
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
| # List all symlinks | |
| find . -type l | awk '{ sub(/.\/+/, ""); print }' | |
| # List broken symlinks | |
| find -L . -type l |