- Git is like a key-value store
- key = data
- value = hash of the data
- The key (SHA1)
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 | |
| // https://gist.github.com/magnetikonline/650e30e485c0f91f2f40 | |
| class DumpHTTPRequestToFile { | |
| public function execute($targetFile) { | |
| $data = sprintf( | |
| "%s %s %s\n\nHTTP headers:\n", | |
| $_SERVER['REQUEST_METHOD'], | |
| $_SERVER['REQUEST_URI'], |
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 | |
| /** | |
| * Save the image on the server. | |
| */ | |
| function save_image( $base64_img, $title ) { | |
| // Upload dir. | |
| $upload_dir = wp_upload_dir(); | |
| $upload_path = str_replace( '/', DIRECTORY_SEPARATOR, $upload_dir['path'] ) . DIRECTORY_SEPARATOR; |
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
| # http://jerwinroy.blogspot.com/2015/04/view-current-userhostport-and-database.html | |
| prompt = function() { | |
| user = db.runCommand({connectionStatus:1}).authInfo.authenticatedUsers[0] | |
| host = db.getMongo().toString().split(" ")[2] | |
| curDB = db.getName() | |
| if (user) { | |
| uname = user.user | |
| } | |
| else { |
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
| netsh wlan show profiles key=clear name=<network-ssid> |
- For your local dev, create a
Dockerfilethat is based on your production image and simply installxdebuginto it. Exemple:
FROM php:5
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \

