Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Fellows mafellows

View GitHub Profile
View Shopify Samples
# Get Products
shop_url = "https://%s:%s@my-shop-url.myshopify.com/admin/api/%s" % ('username', 'password', '2020-01')
shopify.ShopifyResource.set_site(shop_url)
products = shopify.Product.find()
for product in products:
try:
print('====')
print(product.id)
View gist:2e519bb8e312f8bfe4499d5d43f02ef0
import json
import decimal
import os
import datetime
from facebook_business.adobjects.adaccount import AdAccount
from facebook_business.adobjects.adsinsights import AdsInsights
from facebook_business.api import FacebookAdsApi
account_uuid = '1d171536-e162-436c-8c47-1ff54456a3e4'
response = table.query(
View SignIn.vue
<template>
<div>
<amplify-authenticator v-bind:authConfig="authConfig"/>
</div>
</template
<script>
import { Auth } from "aws-amplify";
export default {
name: 'SignIn',
data() {
View gist:10f3f199e52e55b7be563228f66a553e
<script type="text/javascript">
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
@mafellows
mafellows / cors_config.yaml
Created Feb 21, 2020
API Gateway CORS Configuration with CloudFormation
View cors_config.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
Sample CORS Configuration with CORS and API Gateway.
View the full post at https://broadwaylab.com/api-gateway-cors-configuration-with-cloudformation
Resources:
# Global API
AppApi:
Type: AWS::Serverless::Api
@mafellows
mafellows / README-Template.md
Created Apr 5, 2018 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

View gist:bb18477ec6d25f70cac7a8f327c7407e
UNUserNotificationCenter.current().getNotificationSettings { settings in
let authorizationStatus: UNAuthorizationStatus = settings.authorizationStatus
// Handle authorization status
}
View gist:f79d81a87b99417b8e0db3c26b261fde
// Generates a compiler error
foos.forEach { foo in
guard let bar = foo else { continue }
print(bar)
}
// Works fine.
for foo in foos {
guard let bar = foo else { continue }
print(bar)
View gist:417acc60566fc8e8e9db8700c61ce06f
/!*
Only fetch the keys you need when doing queries.
Fetching lots of info per contact is a big performance hit.
*/
let keys = CNContactFormatter.descriptorForRequiredKeys(for: .fullName)
// This will get contacts from the default container.
let contactStore = CNContactStore()
let defaultContainerIdentifier = contactStore.defaultContainerIdentifier()
View gist:c25816672688428344df
Map<String, String> videoParams = new HashMap<String, String>();
// This is an example of logging the 'Ooh La La' video as it's played
videoParams.put("video", "Played_Ooh_La_La_Video");
// Make sure the event name for all videos is 'Played_Video'
FlurryAgent.logEvent("Played_Video", videoParams);