Skip to content

Instantly share code, notes, and snippets.

View mafellows's full-sized avatar

Michael Fellows mafellows

  • Austin, TX
View GitHub Profile
# 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)
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(
@mafellows
mafellows / cors_config.yaml
Created February 21, 2020 22:18
API Gateway CORS Configuration with CloudFormation
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
<template>
<div>
<amplify-authenticator v-bind:authConfig="authConfig"/>
</div>
</template
<script>
import { Auth } from "aws-amplify";
export default {
name: 'SignIn',
data() {
<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 / README-Template.md
Created April 5, 2018 00:01 — forked from PurpleBooth/README-Template.md
A template to make good README.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

UNUserNotificationCenter.current().getNotificationSettings { settings in
let authorizationStatus: UNAuthorizationStatus = settings.authorizationStatus
// Handle authorization status
}
// 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)
/!*
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()
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);