Creating a blackhole in Ubuntu 20.04
Magento 2 Token based authentication:
Official docs: http://devdocs.magento.com/guides/v2.2/get-started/authentication/gs-authentication-token.html
Discussion about Magento 2 API authentication: https://community.magento.com/t5/Just-Ask-Alan/Magento-2-OAuth-authentication-and-REST-API-access/td-p/22528
- Project (Drupal) is served on
/var/www/htmlin the Vagrant box - Local project files location:
c:\Users\username\Work\projects\my-project\repo\html - Guest machine IP is 10.0.2.2 (if this doesn't work, run
route -neein the VM and look for the gateway address)
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
| # Author: Luke Schoen 2017 | |
| import pandas as pd | |
| import numpy as np | |
| import functools | |
| # Create DataFrame | |
| # df = pd.DataFrame(np.random.randn(10,2)) | |
| # Populate with NaN values | |
| df = pd.DataFrame({'col1': ['1.111', '2.111', '3.111', '4.111'], 'col2': ['4.111', '5.111', np.NaN, '7.111'], 'col3': ['8', '9', np.NaN, np.NaN], 'col4': ['12', '13', '14', '15']}) |
- Create a gist if you haven't already.
- Clone your gist:
# make sure to replace `<hash>` with your gist's hash git clone https://gist.github.com/<hash>.git # with https git clone git@gist.github.com:<hash>.git # or with ssh
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 | |
| /** @var \Illuminate\Filesystem\FilesystemAdapter $fs */ | |
| $fs = \Storage::disk('object_storage'); | |
| /** @var \League\Flysystem\Filesystem $driver */ | |
| $driver = $fs->getDriver(); | |
| /** @var \League\Flysystem\AwsS3v3\AwsS3Adapter $adapter */ | |
| $adapter = $driver->getAdapter(); |
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
| curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer |
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
| tar xOf dump.sql.tar.gz | mysql -u $user -p $database |
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($) { | |
| $.fn.serializeFiles = function() { | |
| var form = $(this), | |
| formData = new FormData() | |
| formParams = form.serializeArray(); | |
| $.each(form.find('input[type="file"]'), function(i, tag) { | |
| $.each($(tag)[0].files, function(i, file) { | |
| formData.append(tag.name, file); | |
| }); |