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
| function add_upload_mime_types( $mimes ) { | |
| if ( function_exists( 'current_user_can' ) ) | |
| $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' ); | |
| if ( !empty( $unfiltered ) ) { | |
| $mimes['apk'] = 'application/vnd.android.package-archive'; | |
| } | |
| return $mimes; | |
| } | |
| add_filter( 'upload_mimes', 'add_upload_mime_types' ); |
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
| <!--https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-14-04--> |
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
| // left: 37, up: 38, right: 39, down: 40, | |
| // spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36 | |
| var keys = { | |
| 37: 1, | |
| 38: 1, | |
| 39: 1, | |
| 40: 1 | |
| }; | |
| function preventDefault(e) { |
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
| <EMBED height=60 pluginspage=http://www.macromedia.com/go/getflashplayer src=http://www.jb51.net/flash/flash.swf type=application/x-shockwave-flash width=468 wmode="transparent" quality="high"></EMBED> |
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
| mysqldump -u username -p database_to_backup > backup_name.sql | |
| mysql -u username -p | |
| CREATE DATABASE database_name; | |
| exit | |
| mysql -u username -p database_name < backup_name.sql | |
| //https://www.digitalocean.com/community/tutorials/how-to-backup-mysql-databases-on-an-ubuntu-vps |
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
| server{ | |
| listen 443 ssl; | |
| server_name www.mydomain.com; | |
| root /www/mydomain.com/; | |
| ssl on; | |
| ssl_certificate /ssl/domain.crt; | |
| ssl_certificate /ssl/domain.key; | |
| . | |
| . |
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
| sudo pip install virtualenv | |
| sudo apt-get install python3 | |
| virtualenv --no-site-packages --python=python3.4 test_env | |
| 如果出现The executable python does not exist 错误,那么可以这样使用 | |
| virtualenv --no-site-packages --python=3.4 test_env | |
| source test_env/bin/activate | |
| pip install django |
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
| sudo apt-get update | |
| sudo apt-get install chromium-browser | |
| sudo apt-get install pepperflashplugin-nonfree | |
| sudo update-pepperflashplugin-nonfree --install | |
| sudo apt-get remove chromium-browser pepperflashplugin-nonfree |
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
| git filter-branch --force --index-filter \ | |
| 'git rm --cached --ignore-unmatch Rakefile' \ | |
| --prune-empty --tag-name-filter cat -- --all | |
| Rewrite 48dc599c80e20527ed902928085e7861e6b3cbe6 (266/266) | |
| Ref 'refs/heads/master' was rewritten | |
| echo "Rakefile" >> .gitignore | |
| git add .gitignore | |
| git commit -m "Add Rakefile to .gitignore" |
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
| git init | |
| git add . | |
| # Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'. | |
| git commit -m "First commit" | |
| # Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again. | |
| git remote add origin remote repository URL | |
| # Sets the new remote |