# Install pipenv
pip install pipenv
# Create Venv
pipenv shell
<?php | |
/** | |
* Strip the namespace from the class to get the actual class name | |
* | |
* @param string $obj Class name with full namespace | |
* | |
* @return string | |
* @access public | |
*/ |
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
At October 11, 2019, I published a Javascript library to to run the resumable upload for Google Drive. When this is used, the large file can be uploaded. You can also use this js library.
This is a sample script for uploading files to Google Drive using Javascript. The files are uploaded by Drive API v3. gapi.client.drive.files.create()
can create an empty file on Google Drive. But it cannot directly upload files including contents. I think that this might not be able to upload files and metadata with the multipart/related, although this might be resolved by the future update. So now, as one of workarounds, I use using XMLHttpRequest.
One day in your Laravel app, you were required to redirect all http
requests to https
but need to make a certain URL route accessible via http
for a certain reason; perhaps a portion of your javascript code needs to redirect to http
URL but it can't because redirection to secure URL to insecure is prohibited. Therefore, in cases like this, you need to just allow just one URL to make an http
connection.
NOTE: There are obvious security implications here so don't just follow this blindly and understand if this is really the solution you're looking for. The nginx config can somehow be improved, I just don't have the time yet. It sure do look redundant.
http
to https
# Best if added to `after.sh` so that this gets run every time the box is provisioned | |
# composer won't be able to download updates with an active proxy, and will hang trying to get the newest file | |
# You may want to comment this out based on your network configuration | |
sudo bash -c 'echo "export NO_PROXY=*" >> ~/.profile' | |
sudo add-apt-repository ppa:ondrej/php -y | |
sudo apt-get update | |
sudo apt-get install php7.2-dev php7.2-xml mcrypt php-pear php-mbstring unixodbc unixodbc-dev -y --allow-unauthenticated |
const axios = require('axios').default; | |
axios.interceptors.request.use(x => { | |
const headers = { | |
...x.headers.common, | |
...x.headers[x.method], | |
...x.headers | |
}; |
Just a collection gist of some assorted example SOAPClients. Code must not be stable or useful under all circumstances, these are examples. Most of the code is outdated, so you won't need to use it any longer in production code. I've just collected and compiled this together out of interest, the information normally is scattered around.
If you need to a start with PHP's SOAPClient start with the PHP manual page of it and read through the comments as well. Double check with exisiting bug-reports if given as many things are fixed since a comment was left.
<?php | |
//answer for https://www.testdome.com/questions/php/file-owners/11840?visibility=17&skillId=5 | |
class FileOwners | |
{ | |
public static function groupByOwners($files) | |
{ | |
$result=array(); | |
foreach($files as $key=>$value) | |
{ | |
$result[$value][]=$key; |
var data = "do shash'owania"; | |
var crypto = require('crypto'); | |
crypto.createHash('md5').update(data).digest("hex"); |