Skip to content

Instantly share code, notes, and snippets.

$client = $this->getServiceLocator()->get('PaypalAdaptiveHttpClient');
$client->setUri($this->getConfig()['url'] . '/' . $name);
$client->setParameterPost($queryParams);
$httpResponse = $client->send();
return json_decode($httpResponse->getBody());
<?php
namespace Pledgevine\Db;
use Zend\Db\Sql\Select;
use Zend\Db\TableGateway\AbstractTableGateway;
//works exactly like a table gateway except it wont throw exceptions if you havent specified a table
//notice the lines are just commented
//
<?php
namespace Pledgevine\Db;
use Zend\Db\Sql\Select;
use Zend\Db\TableGateway\AbstractTableGateway;
//works exactly like a table gateway except it wont throw exceptions if you havent specified a table
//notice the lines are just commented
//
public function getMobileDeviceType()
{
//get the detector
$detect = new \Detection\MobileDetect();
$type = false;
if ($detect->isMobile()) {
$type = "phone";
if ($detect->isTablet()) {
$type = "tablet";
public function getMobileDeviceType()
{
//get the detector
$detect = new \Detection\MobileDetect();
$type = false;
if ($detect->isMobile()) {
$type = "phone";
if ($detect->isTablet()) {
$type = "tablet";
<?php
namespace Subscription\Service;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
class SubscriptionService implements SubscriptionInterface, ServiceLocatorAwareInterface
{
use ServiceLocatorAwareInterface;
<?php
namespace Subscription\Service;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
class SubscriptionService implements SubscriptionInterface, ServiceLocatorAwareInterface
{
use ServiceLocatorAwareInterface;
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>;
<script type="text/javascript" src="http://s.sharethis.com/loader.js"></script>;
<script type="text/javascript">stLight.options({publisher: "a3bbd2cb-00a8-4400-8bd6-18f000fd7ea5", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
<script>
var options={ "publisher": "a3bbd2cb-00a8-4400-8bd6-18f000fd7ea5", "position": "left", "ad": { "visible": false, "openDelay": 5, "closeDelay": 0}, "chicklets": { "items": ["facebook", "twitter", "linkedin", "pinterest", "email", "sharethis"]}};
<?php
$form = new \Zend\Form\Form;
$form->setInputFilter($formFilter = new \Zend\InputFilter\InputFilter());
$fieldSet = new \Zend\Form\FieldSet;
$fieldSet->setName('subforms');
$subForm = new \Zend\Form\Form;
@nclundsten
nclundsten / gist:9311705
Created March 2, 2014 18:57
ssl nginx dev tld
# from terminal:
sudo openssl req -new -x509 -nodes -out /etc/nginx/server.crt -keyout /etc/nginx/server.key
chmod 600 /etc/nginx/server.key
# add these lines in virtual.conf under "server":
listen 443 ssl;
server_certificate /etc/nginx/server.crt;
server_certificate_key /etc/nginx/server.key;