Skip to content

Instantly share code, notes, and snippets.

View Nathan-Srivi's full-sized avatar

Nathan Nathan-Srivi

  • Madurai
View GitHub Profile
@Nathan-Srivi
Nathan-Srivi / braintree_create_merchant.php
Last active August 29, 2015 14:21
Braintree create merchant
<?php
require_once 'lib/Braintree.php';
Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('pgd5mp9hwy86jk52');
Braintree_Configuration::publicKey('r2g6qwtr7n9q8fnm');
Braintree_Configuration::privateKey('7ed14b6e3e256baa9b468eee6eb86146');
$validParams = array(
function output()
{
// Check authorization
if(is_authorized())
{
@Nathan-Srivi
Nathan-Srivi / my config.txt
Last active August 29, 2015 14:07
my config file
return array(
'app_id' => '<my app id>',
'app_secret' => '<secret key>',
'access_token' => '149LIvZChokbuhabGRrKGlcJromc1QptEjrMch3wGuE8ae4RiuzMj9Mp8aZBWn09HelyVZB5ItsQZCiOwvoXJIivUWjhgn5uZA9Ld7WadAhEahoXK1MVosbDuS1iSG4uLE215jynfs7iMGnTV2USEhx8OWSc4ZD',
// i got this key from graph api explorer
'act_id' => '524189191044409', //got act id also from graph api explorer
'act_timezone' => '',
'page_id' => '',
);
@Nathan-Srivi
Nathan-Srivi / facebook_ads_error.txt
Created October 8, 2014 08:19
Facebook ads api error?
root@Devel-56:/var/www/facebook-php-ads-sdk# ./vendor/bin/phpunit -c test/
PHPUnit 4.3.1 by Sebastian Bergmann.
Configuration read from /var/www/facebook-php-ads-sdk/test/phpunit.xml
...E....EEEEEEEEEEEE.EEE
Time: 45.59 seconds, Memory: 7.50Mb
There were 16 errors:
@Nathan-Srivi
Nathan-Srivi / error_file.php
Created September 25, 2014 12:46
working & Error codes when import records into prediction io
<?php
$k = array(121,124,126,128);//my product ids.. I need to pass this type of ids
foreach($k as $productid)
{
$client->execute($client->getCommand('record_action_on_item', array('pio_action' => 'view', 'pio_iid' => $productid)));
}
?>
@Nathan-Srivi
Nathan-Srivi / create_user.php
Created September 25, 2014 10:31
Prediction io PHP
<?php session_start();
error_reporting(1) ;
// use composer's autoloader to load PredictionIO PHP SDK
require_once("vendor/autoload.php");
use PredictionIO\PredictionIOClient;
$client = PredictionIOClient::factory(array("appkey" => "mJmKNgP7xnzq7xGBkSRdwk1aqfVL96Q3z3g0GVWIKaxfgafCrmWWunP7iVESCDKy"));
//$client = Flight::prediction_client();
for($i=1;$i<10;$i++)
{
@Nathan-Srivi
Nathan-Srivi / show.php
Created September 25, 2014 10:20
prediction io show page
<?php session_start();
require_once("vendor/autoload.php");
use PredictionIO\PredictionIOClient;
$client = PredictionIOClient::factory(array("appkey" => "6DzhlG31iEHRo1ThUeIswYoXBHYq825Xg8d8ZooUymdXVLBOvbWRBCyCIhfLEAhs"));
try{
$user_id = 6;
$client->identify($user_id);