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 | |
| mdate=`date +%Y%m%d` | |
| mkdir -p /root/db/${mdate} $ | |
| cd /var/lib/mysql/ | |
| for db in $(ls -d */); do | |
| echo -n "Backuping "${db%%/}" ... " | |
| mysqldump -u root ${db%%/} > /root/db/${mdate}/${db%%/}.sql |
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
| /*Directive filereader*/ | |
| angular.module('youAppName') | |
| .directive('fileread', function ($parse) { | |
| return { | |
| restrict: 'A', | |
| require: 'ngModel', | |
| link: function(scope, element, attrs, ctrl) { | |
| var model = $parse(attrs.ngModel); | |
| var modelSetter = model.assign; |
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
| # YOU MUST BE IN USER ROOT | |
| #Install virtualenvwrapper | |
| pip install virtualenvwrapper | |
| #Setup virtualenvwrapper | |
| sudo gedit .bashrc | |
| #Copy at the end of the file | |
| export WORKON_HOME=$HOME/.virtualenvs |
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
| MYSQL: | |
| -sudo apt-get install mysql-serve | |
| POSTGRESQL: | |
| https://www.digitalocean.com/community/articles/how-to-install-and-use-phppgadmin-on-ubuntu-12-04 | |
| sudo apt-get install postgresql postgresql-client postgresql-contrib | |
| POSTGRESQL python driver: | |
| sudo apt-get install postgresql-plpython | |
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
| var arr = [ 1, 9, 3, 8, 6, 1, 5, 9, 4, 7, 3, 8, 6, 9, 1 ]; | |
| arr = jQuery.grep(arr, function(n, i){ | |
| return (n != 5 && i > 4);}); | |
| 1, 9, 4, 7, 3, 8, 6, 9, 1 |