Skip to content

Instantly share code, notes, and snippets.

View nmwalsh's full-sized avatar
💻

Nick Walsh nmwalsh

💻
View GitHub Profile
@nmwalsh
nmwalsh / select a language version
Created July 19, 2018 04:23
select a language version
(1) py27
(2) py35
Please select one of the above environment language (e.g. py27):
@nmwalsh
nmwalsh / charge_credit_card.py
Last active September 14, 2018 05:44
Boilerplate credit card charge function using the Authorize.Net python SDK
from authorizenet import apicontractsv1
from authorizenet.apicontrollers import*
from decimal import*
import credentials # importing our credentials from credentials.py
# Authentication steps using Authorize.Net API credentials
merchantAuth = apicontractsv1.merchantAuthenticationType()
merchantAuth.name = credentials.api_login_name
merchantAuth.transactionKey = credentials.transaction_key
import boto3
# instantiate local comprehend client
comprehend_client = boto3.client('comprehend')
text = "A classic love heart emoji, used for expressions of love. Displayed in various shades of red on most platforms. A similar emoji exists for the heart suit in a deck of playing cards. On Snapchat, this emoji displays next to a friend when you have been #1 BFs with each other for two consecutive weeks."
# Invoke detect_key_phrases endopint and get response
comprehend_response = comprehend_client.detect_key_phrases(Text=text, LanguageCode='en')