Skip to content

Instantly share code, notes, and snippets.

View angelo510's full-sized avatar
🏠
Working from home

Angelo ^_^ angelo510

🏠
Working from home
  • Independent Freelancer
View GitHub Profile
@angelo510
angelo510 / salesforce_snippet1
Created January 23, 2017 18:07
salesforce_snippet1
<?php
namespace Xsolve\SalesforceClient\Client;
use GuzzleHttp\Psr7\Request;
use Http\Client\Exception\HttpException;
use Http\Client\HttpClient;
use Psr\Http\Message\ResponseInterface;
use Xsolve\SalesforceClient\Enum\ContentType;
use Xsolve\SalesforceClient\Generator\TokenGeneratorInterface;
use Xsolve\SalesforceClient\Request\RequestInterface;
use Xsolve\SalesforceClient\Security\Token\TokenInterface;
@angelo510
angelo510 / ResizeImage.php
Created January 19, 2017 17:18
Magento Resize Image
<?php
namespace EShop\ImageResizer\Controller\Adminhtml\Cache;
use Magento\Backend\App\Action\Context;
use Magento\Backend\Controller\Adminhtml\Cache as MagentoAdminCache;
use Magento\Framework\App\Cache\Frontend\Pool;
use Magento\Framework\App\Cache\StateInterface;
use Magento\Framework\App\Cache\TypeListInterface;
use Magento\Framework\Exception\LocalizedException;
@angelo510
angelo510 / magento_customer.php
Created January 19, 2017 16:55
Magento Customer
<?php
$countryCollection = Mage::getModel('directory/country_api')->items();
function getCountryId($country_name){
global $countryCollection;
$country_name = trim($country_name);
foreach ($countryCollection as $country) {
if (strtolower($country['name']) == strtolower($country_name)){
return $country['country_id'];
}elseif (strtolower($country['country_id']) == strtolower($country_name)) {
return $country['country_id'];