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 | |
if( $_POST["name"] ) | |
{ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL,"https://YOUR_SUBDOMAIN.host.com/api/v1/leads?api_key=YOUR_API_KEY"); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
// example splitting a name field into first and last name bits | |
$pieces = explode(" ", $_POST['name']); | |
$last_name_parts = array_slice($pieces, 1); //each word |
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
def self.round_to_five_minutes(minute) | |
all = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55] | |
higher = nil | |
lower = nil | |
all.each_with_index do |five_min,index| | |
if minute == five_min | |
return five_min | |
end | |
if five_min > minute | |
higher = five_min |
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
@gateway = ActiveMerchant::Billing::UsaEpayGateway.new login: 'KEYHERE', password: '1234', software_id: 'ABC123' | |
credit_card = ActiveMerchant::Billing::CreditCard.new( | |
:number => '4000100011112224', | |
:verification_value => 123, | |
:month => 9, | |
:year => 2014, | |
:first_name => 'Bob', | |
:last_name => 'Bobsen' | |
) |
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
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0" class="main-table"> | |
<tr> | |
<td width="18" height="20"> </td> | |
<td width="714" valign="top"> </td> | |
<td width="18"> </td> | |
</tr> | |
<tr> | |
<td> </td> |
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
<style type="text/css"> | |
.rs-widget-container { | |
position: relative; | |
padding-bottom: 56.25%; | |
padding-top: 35px; | |
height: 100%; | |
} | |
.rs-widget-container iframe { | |
position: absolute; | |
top:0; |
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
=> #<ActiveMerchant::Billing::Response:0x007fb45c9c7878 @params={"run_sale_return"=>{"acs_url"=>nil, "auth_amount"=>"0", "auth_code"=>"000000", "avs_result"=>"No AVS response (Typically no AVS data sent or swiped transaction)", "avs_result_code"=>nil, "batch_num"=>"1", "batch_ref_num"=>"108410", "card_code_result"=>"No CVV2/CVC data available for transaction.", "card_code_result_code"=>nil, "card_level_result"=>"Unknown Code ", "card_level_result_code"=>nil, "conversion_rate"=>"0", "converted_amount"=>"0", "converted_amount_currency"=>nil, "cust_num"=>"0", "error"=>"Invalid Card Number (1)", "error_code"=>"11", "is_duplicate"=>"false", "payload"=>nil, "ref_num"=>"60056770", "result"=>"Error", "result_code"=>"E", "status"=>"Pending", "status_code"=>"P", "vpas_result_code"=>nil}}, @message={"acs_url"=>nil, "auth_amount"=>"0", "auth_code"=>"000000", "avs_result"=>"No AVS response (Typically no AVS data sent or swiped transaction)", "avs_result_code"=>nil, "batch_num"=>"1", "batch_ref_num"=>"108410", "card_code_ |
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
int sensorPin = 0; | |
int ledPin = 1; | |
int sensorVal = 0; | |
int counter = 0; | |
void setup() | |
{ | |
// strip.begin(); | |
// strip.show(); // Initialize all pixels to 'off' |
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
task :import_invoices_with_api_client => :environment do | |
begin | |
#CustomerName,CustomerPhone,Invoice Date,Invoice Subtotal,Invoice Tax,Invoice Total,Invoice Number | |
path = "#{Rails.root}/tmp/test.csv" | |
subdomain = 'ithelpdesk' | |
api = TroysAPIClient.new(subdomain,'API_KEY') | |
api.base_url = "https://#{subdomain}.repairshopr.com" |
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
@subdomain = 'subdomain' | |
@api_key = 'api_key' | |
@api_version = "/api/v1" | |
base_url = "https://#{@subdomain}.repairshopr.com" | |
subtotal = 150.00 | |
number = "12345" | |
invoice = {} | |
invoice[:date] = Time.now | |
invoice[:paid] = 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 | |
$subdomain = 'subdomain'; | |
$api_key = 'api_key'; | |
$api_version = '/api/v1'; | |
$base_url = "https://$subdomain.repairshopr.com"; | |
$subtotal = 150.00; | |
$number = '12345'; | |
$invoice = array(); | |
$invoice["date"] = date('Y-m-d H:i:s'); |