Skip to content

Instantly share code, notes, and snippets.

View mfwarren's full-sized avatar
🇨🇦
Working

Matt Warren mfwarren

🇨🇦
Working
View GitHub Profile
@mfwarren
mfwarren / shopify_ltv.py
Created January 27, 2023 03:08
calculate a 60-day LTV out of the most recent 90 days of sales history
from datetime import datetime, timedelta
import shopify
ACCESS_TOKEN = 'YOUR ADMIN TOKEN'
def shopify_orders():
shop_url = "YOURSTORE.myshopify.com"
api_version = '2022-07'
### Keybase proof
I hereby claim:
* I am mfwarren on github.
* I am matt_warren (https://keybase.io/matt_warren) on keybase.
* I have a public key ASC1qUfJxHAPnsdOf6mtMOH2NVBURl9pl4fXDOFwVJwzcgo
To claim this, I am signing this object:
import scrapy
from twx.botapi import TelegramBot
class LCBOSpider(scrapy.Spider):
name = 'lcbospider'
start_urls = ['http://www.lcbo.com/lcbo/search/filter?showAll=LTO#contentBeginIndex=0&productBeginIndex=0&beginIndex=0&orderBy=&categoryPath=%2F%2F&pageView=&resultType=products&orderByContent=&searchTerm=&facet=&storeId=10151&catalogId=10001&langId=-1&fromPage=&showAll=LTO&objectId=&requesttype=ajax']
custom_settings = {
'CONCURRENT_REQUESTS': 2
@mfwarren
mfwarren / checkout.html
Created March 22, 2013 23:04
example html/JavaScript usage of using vogogo.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Vogogo Sample Form</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
<script type="text/javascript" src="https://api.vogogo.com/vogogo.js/"></script>
<script type="text/javascript">
@mfwarren
mfwarren / .ctags
Created January 24, 2011 16:34
my .ctags syntax file for Groovy language (exuberant-ctags)
--langdef=groovy
--langmap=groovy:.groovy
--regex-groovy=/^[ \t]*[(private|public|protected) ( \t)]*def[ \t]+([A-Za-z0-9_]+)[ \t]*\(/\1/f,function,functions/
--regex-groovy=/^[ \t]*private def[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/v,private,private variables/
--regex-groovy=/^[ \t]*public def[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/u,public,public variables/
--regex-groovy=/^[ \t]*[abstract ( \t)]*[(private|public) ( \t)]*class[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/c,class,classes/
--regex-groovy=/^[ \t]*[abstract ( \t)]*[(private|public) ( \t)]*enum[ \t]+([A-Za-z0-9_]+)[ \t]*/\1/c,class,classes/