This file contains 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 | |
use MyApp\Tests\TestCase; | |
class ProductImporterTest extends TestCase | |
{ | |
/** | |
* @dataProvider providerProductFile | |
*/ |
This file contains 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 | |
use MyApp\Library\Feeds\ProductImporter; | |
class ProductImporterTest extends PHPUnit_Framework_TestCase | |
{ | |
public function testImportingProducts() | |
{ | |
// Imagine this was a sample array of data. |
This file contains 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 | |
$constraints = [ | |
// Here is the issue, I want to assert the vendor_num key | |
// of the $vendor array below is both not blank AND has | |
// a length <= 24 (and who knows, more constraints down the road). | |
// The issue is that Collection() expects vendor_num to | |
// be an array. How to do I chain these without calling | |
// addPropertyConstraint() a bunch because I don't have access to it. | |
'vendor_num' => new Assert\Collection([ |
This file contains 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 | |
class Histogram | |
{ | |
/** @var array */ | |
private $buckets = []; | |
/** @var integer */ | |
private $count = 0; |
This file contains 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 | |
// Configuration, using AWS SDK 2.6.16 | |
return [ | |
'includes' => ['_aws'], | |
'services' => [ | |
'default_settings' => [ | |
'params' => [ | |
'key' => 'xxx', | |
'secret' => 'yyyy', |
This file contains 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
paths: | |
migrations: %%PHINX_CONFIG_DIR%%/../migrations | |
environments: | |
default_migration_table: _migrations | |
default_database: test | |
prod: | |
adapter: pgsql | |
host: "@@DB_SETTINGS_HOST@@" | |
name: "@@DB_SETTINGS_DATABASE@@" |
This file contains 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 | |
// This fails, but only on staging (DigitalOcean) server. | |
// Works fine on production (Linode) server. | |
// Please ignore bad security practices. | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, 'https://server.com:2143'); | |
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); | |
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST'); | |
curl_setopt($curl, CURLOPT_POSTFIELDS, '<CommandQuery/>'); |
This file contains 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($app, $jQuery) { | |
"use strict"; | |
var CampaignGroupCollection = function(options) { | |
this.init(options); | |
}; | |
CampaignGroupCollection.prototype.init = function(options) { | |
this.collection = options.collection; | |
this.campaignGroups = []; |
This file contains 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
server { | |
listen 80; | |
server_name expertphpdeployments.com www.expertphpdeployments.com; | |
return 301 https://expertphpdeployments.com$request_uri; | |
} | |
server { | |
listen 443; | |
server_name expertphpdeployments.com; |
This file contains 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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; |
NewerOlder