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 global setup: | |
| git config --global user.name "user" | |
| git config --global user.email "[email protected]" | |
| Create Repository | |
| mkdir new_repo | |
| cd new_repo | |
| git init |
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
| protected function _timeToDecimal($time){ | |
| list($hours,$minutes) = array_pad(explode(':',$time, 2), 2, null); | |
| if(is_null($minutes)) $minutes = '00'; | |
| if(strstr($hours, '-')){ | |
| $negative=true; | |
| $hours = 0 - $hours; | |
| }else{ | |
| $negative= false; |
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 didn’t like that some of the permissions had changed on the files within my repos. | |
| So, after reading the manual for a while, I discovered I could issue the following: | |
| git config core.filemode false | |
| According to the git manual: |
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
| Example syntax for Secure Copy (scp) | |
| What is Secure Copy? | |
| scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh. | |
| Examples | |
| -------- | |
| Copy the file "foobar.txt" from a remote host to the local host |
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
| //use EXAMPLE | |
| $response = SendPostData($_POST, 'http://www.myserver2location.com/receive-data.php'); | |
| /** | |
| * SendPostData() | |
| * | |
| * @param mixed $_p | |
| * @param mixed $remote_url |
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 | |
| // An example class | |
| class MyClass | |
| { | |
| /** | |
| * A test function | |
| * | |
| * First parameter must be an object of type OtherClass |
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 | |
| /** | |
| * html selectors | |
| * | |
| * set of html selectors on dashboard and ... | |
| * | |
| * TODO OPTIONS | |
| * 1. pass one big array and loop to create selectors | |
| * 2. add specific functionality |
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
| change from https to ssh | |
| example: git remote set-url origin [email protected]:user/gitname.git |
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
| #.htaccess | |
| AuthName "Restricted Area" | |
| AuthType Basic | |
| AuthUserFile /var/www/path to /public_html/.htpasswd | |
| AuthGroupFile /dev/null | |
| require valid-user | |
| #.htpasswd |
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
| /* | |
| * NOTES: | |
| * | |
| * TODO: Consider some static methods or running the logger as a plugin | |
| * | |
| * | |
| */ | |
| class Logger { |