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
class Analytics::RefreshIdentifiesService | |
# This service is explicitly written to send identify calls for users | |
# that have incorrect attributes in Braze. The flow for this service is as | |
# follows: | |
# | |
# 1. Find all users that have been updated in the last hour | |
# 2. For each user, pull the corresponding user attributes for that user | |
# from Braze using the Braze REST API (via the Braze-Ruby gem) | |
# 3. If the traits in the user's identify_data is different than what comes | |
# from Braze (that is, there are either new attributes or changed attributes), |
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
#!/usr/bin/env ruby | |
# Place in your .git/hooks directory | |
# Prevents rails assets commotted to master and other merge conflicts, etc | |
def on_master? | |
`git rev-parse --abbrev-ref HEAD`.include?("master") | |
end | |
# Don't allow master to have a manifest | |
if on_master? && File.directory?("public/assets") |
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
Chef::Log.info("Precompiling assets for RAILS_ENV=#{rails_env}...") | |
# Precompile assets. Assets are compiled into shared/assets and shared between deploys. | |
shared_path = "#{new_resource.deploy_to}/shared" | |
# create shared directory for assets, if it doesn't exist | |
directory "#{shared_path}/assets" do | |
mode 0770 | |
action :create | |
recursive true |
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 apiProcessor{ | |
private $gets; | |
private $posts; | |
public function __construct($gets,$posts){ | |
$this->gets = $gets; | |
$this->posts = $posts; | |
} | |
public function process(){ | |
$url = $this->gets['url']; |
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 | |
//$info = $order->info(); | |
$info = array( | |
'email' => '[email protected]', | |
'first' => 'Bob'. | |
'last' => 'Roberts' | |
); | |
$pardotConnector = new PardotConnector(); | |
//Keep credentials secure |
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 | |
$pardotConnector = new PardotConnector(); | |
//Keep credentials secure | |
$pardotConnector->authenticate($username,$password,$userKey); | |
//Return array of simpleXMLObject prospects | |
$recentlyUpdatedProspects = $pardotConnector->prospectQuery( | |
$queryCriteria = array( | |
'updated_after'=>'yesterday', | |
'updated_before'=>'last_year', | |
'last_activity_after'=>'last_seven_days', |
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
<? | |
//This is the pseudo code to assign prospects based on a custom field's value | |
$connection = new PardotConnector(); | |
$connection->authenticate(); | |
$prospects = $connection->getRecentlyUpdatedProspects(); | |
foreach($prospects as $prospect){ | |
if($prospect->owner_email!=false){ | |
$prospect->setAssignedUser($prospect->owner_email); | |
} |
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
<? | |
/** | |
Written by James Laughlin | |
http://developer.pardot.com/discussions/questions/55-php-login-example | |
There seems to be little on this forum that is language specific, so If you are using Drupal or Wordpress, you'll need to build interfaces to Pardot in PHP at some point. Here's a function you can use to retrieve your Pardot credentials in one array object so that you can make your API calls. | |
**/ | |
// the pardot API key is only good for an hour | |
// so it's best to get it before every API call | |
function get_pardot_credentials(){ |