Skip to content

Instantly share code, notes, and snippets.

View farrelley's full-sized avatar

Shaun Farrell farrelley

View GitHub Profile
<?php
$configPaths = sprintf(
'%s/config/{,*.}{global,%s,local}.php',
APPLICATION_PATH,
SLIM_MODE
);
$config = Zend\Config\Factory::fromFiles(glob($configPaths, GLOB_BRACE));
$configuration = array(
'callbackUrl' => 'http://stats.local/twitter',
'siteUrl' => 'https://api.twitter.com/oauth',
'requestTokenUrl' => 'https://api.twitter.com/oauth/request_token',
'authorizeUrl' => 'https://api.twitter.com/oauth/authorize',
'accessTokenUrl' => 'https://api.twitter.com/oauth/access_token',
'consumerKey' => '',
'consumerSecret' => ''
);
$consumer = new Zend_Oauth_Consumer($configuration);
REQUEST SENT
{"request":{"action":{"type":"status","data":{"test_string":"This is a Joind.in Test"},"output":"xml"}}}
RESONSE FROM JOIND.IN
object(Zend_Http_Response)#40 (5) {
["version:protected"] => string(3) "1.1"
["code:protected"] => int(200)
["message:protected"] => string(2) "OK"
["headers:protected"] => array(7) {
["Date"] => string(29) "Fri, 21 May 2010 18:44:12 GMT"
<a href="<?php echo $this->url(
array(
'controller' => 'index',
'action' => 'test'
),
array('name' => 'default')
) ?>">test</a>
@farrelley
farrelley / gist:1281324
Created October 12, 2011 14:11
Segment Route
'user' => array(
'type' => 'Zend\Mvc\Router\Http\Segment',
'options' => array(
'route' => '/user/:username',
'defaults' => array(
'controller' => 'index',
'action' => 'index',
),
'match' => array(
'username' => ':username'
@farrelley
farrelley / ttb-goutte-crawl.php
Created June 6, 2012 00:03
Trying to get a list of TTB ID numbers for a specified date. The code works but I am missing something. I keep getting an error "<?php require_once 'goutte.phar'; use Goutte\Client; $client = new Client(); $guzzle = $client->getClient(); $guzzle->se
<?php
require_once 'goutte.phar';
use Goutte\Client;
$client = new Client();
$guzzle = $client->getClient();
$guzzle->setConfig(
array(
@farrelley
farrelley / Test.php
Created June 30, 2012 20:38
This is a test File
<?php
echo "Ronnie Brown";
foreach ($test as $t) {
echo $t;
}
1) ApplicationAdmin_Integration_Domain_ImportTest::testCourseImporterSuccessfullyCreatesCfpCourseFromSchweserDataSource
Exception: array_fill(): Number of elements must be positive
#0 [internal function]: PHPUnit_Util_ErrorHandler::handleError(2, 'array_fill(): N...', '/home/sfarrell/...', 116, Array)
#1 /home/sfarrell/sandboxes/core/code/applicationLms/classes/dao/test.php(116): array_fill(0, 0, '?')
#2 /home/sfarrell/sandboxes/core/code/applicationAdmin/classes/domain/content/test.php(30): Dao_Test->getQuestionDataByQuestionAssignmentIds(Array)
#3 /home/sfarrell/sandboxes/core/code/tests/integration/applicationAdmin/classes/domain/importTest.php(412): Admin_Domain_Content_Test->getHash()
#4 [internal function]: ApplicationAdmin_Integration_Domain_ImportTest->testCourseImporterSuccessfullyCreatesCfpCourseFromSchweserDataSource()
#5 /home/sfarrell/sandboxes/core/code/utilities/PHPUnit/PHPUnit/Framework/TestCase.php(927): ReflectionMethod->invokeArgs(Object(ApplicationAdmin_Integration_Domain_ImportTest), Arra
I was trying to just write a rspec for the Clat model.
method self.active
def self.active
Clat.expire_clats
where(:active => true)
end
this is what i was doing in rspec
# Page
---
layout: xyz
title: Test Post
some_id: ABC
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
# template
---