Skip to content

Instantly share code, notes, and snippets.

@DustyReagan
DustyReagan / blablabla.js
Created September 8, 2021 21:38 — forked from taniagreen/blablabla.js
Pass parameters from PHP to React component - global variables
/// user.php ///
// initialize global variable in a script added to your php file
<script>
window.reactData = {
postId: <?php echo get_the_id(); ?>
};
</script>
@DustyReagan
DustyReagan / gist:2c824bf57c957fda8b4a
Created September 14, 2014 07:58
Bad Request Results
stdClass Object ( [claimed] => 0 [total] => 0 [free] => 0 )
Fatal error: Uncaught exception 'Guzzle\Http\Exception\ClientErrorResponseException' with message 'Client error response [status code] 400 [reason phrase] Bad Request [url] https://dfw.queues.api.rackspacecloud.com/v1/404082/queues/FoF/messages' in /var/sites/FriendOrFollowDusty/library/vendor/guzzle/http/Guzzle/Http/Exception/BadResponseException.php:43 Stack trace: #0 /var/sites/FriendOrFollowDusty/library/vendor/guzzle/http/Guzzle/Http/Message/Request.php(145): Guzzle\Http\Exception\BadResponseException::factory(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Message\Response)) #1 [internal function]: Guzzle\Http\Message\Request::onRequestError(Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher)) #2 /var/sites/FriendOrFollowDusty/library/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Guzzle\Common\Ev
@DustyReagan
DustyReagan / gist:acd99e2d9e4c103586fe
Created September 14, 2014 07:56
Rackspace Queue API
<?php
include_once(APPLICATION_PATH . '/../library/vendor/autoload.php');
use OpenCloud\Rackspace;
$client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array(
'username' => 'myusername',
'apiKey' => 'myapikey'
));
drop table if exists temp_twitter_ids;
create temporary table temp_twitter_ids (`twitter_id` int(10) unsigned);
insert into temp_twitter_ids (`twitter_id`) values (2608911);
@DustyReagan
DustyReagan / save_to_s3.php
Created December 3, 2010 23:39
Creates an Amazon S3 object from a string with PHP
<?php
/**
* Creates an Amazon S3 object from a string
*
* @param $input String (Required) The data to store in the object
* @param $bucket String (Required) Name of the bucket to use.
* @param $filename String (Required) Filename for the object.
* @param $options Array (Optional) An associative array of options specified below.
*
@DustyReagan
DustyReagan / Twitter User Object MySQL Schema.sql
Created April 1, 2010 23:22
Twitter User Object MySQL Schema
CREATE TABLE `user` (
`twitter_id` int(10) unsigned NOT NULL,
`created_at` timestamp NOT NULL default '0000-00-00 00:00:00',
`name` varchar(80) NOT NULL,
`screen_name` varchar(30) NOT NULL,
`location` varchar(120) default NULL,
`description` varchar(640) default NULL,
`profile_image_url` varchar(400) NOT NULL,
`url` varchar(100) default NULL,