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
#!/bin/bash | |
subdir=${1%/} | |
if [ ! $subdir ]; then | |
echo "Please specify an argument" | |
exit | |
fi | |
dir="${PWD}/$subdir" |
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 TestA { | |
public $foo = 'bar'; | |
} | |
$class = new TestA(); | |
var_dump((array) $class); |
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
import os | |
import sys | |
import json | |
rootdir = sys.argv[1] | |
for root, subFolders, files in os.walk(rootdir): | |
for file in files: | |
if (os.path.splitext(file)[1] == '.json'): | |
path = os.path.join(root,file) | |
with open(path,'r') as f: |
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
public function uploadObjects(array $files, array $commonHeaders = array()) | |
{ | |
$requests = $entities = array(); | |
foreach ($files as $entity) { | |
if (empty($entity['name'])) { | |
throw new Exceptions\InvalidArgumentError('You must provide a name.'); | |
} | |
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
use OpenCloud\Rackspace; | |
$client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, [ | |
'username' => 'foo', | |
'apiKey' => 'bar' | |
]); | |
$service = $client->loadBalancerService(); | |
$loadBalancer = $service->loadBalancer('<lb_id>'); |
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
"require": { | |
"rackspace/php-opencloud": "dev-master:d81c8cfff72612f71dccff1e0a03dfe8be874a4c" | |
} |
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 | |
// First make sure you have the BackoffPlugin installed: | |
// $ composer require guzzle/guzzle | |
use Guzzle\Plugin\Backoff\BackoffPlugin; | |
use OpenCloud\Rackspace; | |
$client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array( | |
'username' => 'foo', |
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
use OpenCloud\Rackspace; | |
$client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array( | |
'username' => 'foo', | |
'apiKey' => 'bar' | |
)); | |
$cacheFile = __DIR__ . '/.opencloudToken'; | |
$token = $client->getTokenObject(); |
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 Guzzle\Plugin\Log\LogPlugin; | |
use OpenCloud\Rackspace; | |
$client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array( | |
'username' => 'foo', | |
'apiKey' => 'bar' | |
)); |
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
use Guzzle\Http\ClientInterface; | |
use OpenCloud\Common\Service\CatalogService; | |
class HpService extends CatalogService | |
{ | |
public function __construct(ClientInterface $client, $type = null, $region = null, $urlType = null) | |
{ | |
$this->setClient($client); | |
$this->region = $region; |
OlderNewer