Skip to content

Instantly share code, notes, and snippets.

View igoralves1's full-sized avatar

Igor Alves igoralves1

View GitHub Profile
@igoralves1
igoralves1 / post.php
Created May 10, 2017 12:08
Three Ways to Make a POST Request from PHP
<?php
#https://lornajane.net/posts/2010/three-ways-to-make-a-post-request-from-php
#POSTing from PHP Curl
#----------------------
#First we initialised the connection, then we set some options using setopt().
#These tell PHP that we are making a post request, and that we are sending some
#data with it, supplying the data. The CURLOPT_RETURNTRANSFER flag tells curl
#to give us the output as the return value of curl_exec rather than outputting it.
#Then we make the call and close the connection - the result is in $response.
https://danielmiessler.com/study/url-uri/
https://pt.stackoverflow.com/questions/47194/como-posso-adquirir-https-na-minha-aplica%C3%A7%C3%A3o-web?rq=1
@igoralves1
igoralves1 / testXML.php
Last active May 5, 2017 15:37
Getting a xml by POST, testing some condition in the Request Header
<?php
//Grab and test the header INFO
if (!function_exists('getallheaders'))
{
function getallheadersNGX()
{
$headers = '';
foreach ($_SERVER as $name => $value)
{
if (substr($name, 0, 5) == 'HTTP_')
@igoralves1
igoralves1 / gist:3593d3ec8ef08c70869e84fefbc7683f
Created March 27, 2017 16:15
AngularJs calling a PHP function to generate a CSV fie
<a href="#" target="blank" ng-click="getCSVTemplate('patient')" style="color:#439367;"><img src="assets/svg/icons/csv.svg" class="svg"><br>
{{ someText }}
</a>
//Inside the controller
$scope.getCSVTemplate=function(csvType){
var page = "tools/csvTemplate.php?csvType="+csvType;
document.location.href = page;
}
#Erro no browser
The test.app page isn’t working
dref.app is currently unable to handle this request.
HTTP ERROR 500
#===================================================
@igoralves1
igoralves1 / Reliese_Laravel.php
Last active March 4, 2019 19:16
Create migrations and models from existing database - Reliese Laravel
/*
https://github.com/reliese/laravel
This package expects that you are using Laravel 5.1 or above. You will need to import the reliese/laravel package via composer:
composer require reliese/laravel
Configuration
Add the service provider to your config/app.php file within the providers key:
@igoralves1
igoralves1 / guz.php
Last active November 23, 2020 10:36
Consuming API endpoints with Laravel 5+ AND Guzzle\Http
/*
Installation -> http://docs.guzzlephp.org/en/latest/overview.html#installation
https://www.youtube.com/watch?v=GunXVUqvO-s
https://www.udemy.com/http-clients-with-laravel-use-and-consume-services-and-apis/
add Guzzle as a dependency using the composer.phar CLI:
@igoralves1
igoralves1 / MagentoIni.sh
Last active July 9, 2018 14:42
Magento 2 + NGINX + MariaDB + PHP7
https://www.howtoforge.com/tutorial/how-to-install-magento-with-nginx-on-ubuntu/
http://devdocs.magento.com/guides/v2.1/install-gde/install/sample-data-before-composer.html
http://askubuntu.com/questions/762855/how-to-install-brackets-io-from-the-command-line
http://devdocs.magento.com/guides/v2.1/install-gde/install/sample-data-before-composer.html
http://devdocs.magento.com/guides/v2.1/config-guide/cli/config-cli-subcommands-mode.html
https://github.com/magento/magento2/issues/2561
http://devdocs.magento.com/guides/v2.0/install-gde/install-flow-diagram.html
http://askubuntu.com/questions/762855/how-to-install-brackets-io-from-the-command-line
http://superuser.com/questions/387948/how-can-i-determine-if-apache-is-installed-on-a-system
http://blog.netgusto.com/solving-web-file-permissions-problem-once-and-for-all/