Skip to content

Instantly share code, notes, and snippets.

View codemaster730's full-sized avatar
๐Ÿ 
Working from home

codemaster730

๐Ÿ 
Working from home
  • Earth
View GitHub Profile
@codemaster730
codemaster730 / petstore-swagger.json
Created August 9, 2020 20:28 — forked from domharrington/petstore-swagger.json
petstore with example response json
{
"swagger": "4.0",
"info": {
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
"version": "1.0.0",
"title": "Swagger Petstore",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "[email protected]"
},
@codemaster730
codemaster730 / gist:46c7081d465beba1a166217d3a5543d5
Created April 22, 2018 22:04
Python Nokia Health api integration
auth = NokiaAuth(settings.CONSUMER_KEY, settings.CONSUMER_SECRET)
# Create your views here.
def index(request):
if 'user_id' not in request.session:
authorize_url = auth.get_authorize_url(settings.CALLBACK_URL_PROD)
return render(request, "index.html", {"authorize_url": authorize_url})
else:
return render(request, "success.html", {"message": "Now you can upload your health data..."})
@codemaster730
codemaster730 / gist:94351277cf2da3a4bf59e73eb6d95da7
Created April 19, 2018 04:23
Rails stripe integration sample
def place_order
# Find order by order_id saved in cookie.
order = Order.find cookies[:order_id]
# Get stripe_token whcih returned from stripe.js
token_stripe = params[:order][:token_stripe]
# Process payment(Not create subscription now, Subscription1 manually created in Stripe)
customer = order.process_payment token_stripe
if customer
<iframe id="tweet-button" allowtransparency="true" frameborder="0" scrolling="no"
src="http://platform.twitter.com/widgets/tweet_button.html?via=marcus_christie&amp;text=Replace%20Me&amp;count=horizontal"
style="width:110px; height:20px;"></iframe>