This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before = { | |
"id": "sub_sched_KppC1fgG2c95PyN47xCK2Fdv", | |
"object": "subscription_schedule", | |
"application": None, | |
"canceled_at": None, | |
"completed_at": None, | |
"created": 1690985828.495943, | |
"current_phase": None, | |
"customer": "cust_D2las0ShUdDNJh5GeudIakfm", | |
"default_settings": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b64_encoded_auth = base64.b64encode(f"{APCA_API_KEY_ID}:{APCA_API_SECRET_KEY}".encode()).decode() | |
self.session.headers.update({"Authorization": f"Basic {b64_encoded_auth}"}) | |
with EventSource(url, session=self.session, **kwargs) as client: | |
client.on_error = process_error | |
client.add_event_listener('message', callback=callback) | |
client.open() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# This script stops a SageMaker notebook once it's idle for more than 1 hour (default time) | |
# You can change the idle time for stop using the environment variable below. | |
# If you want the notebook the stop only if no browsers are open, remove the --ignore-connections flag | |
IDLE_TIME=10800 | |
echo "Fetching the autostop script" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Espresso Soda</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""Factories to help in tests.""" | |
import random | |
from datetime import date | |
import factory | |
# noinspection PyPackageRequirements | |
from faker import Faker | |
from .database import db | |
from xxx.controllers import User |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import uuid | |
from string import ascii_letters | |
from enum import Enum | |
import boto3 | |
from datetime import datetime, timezone | |
from bloop import ( | |
BaseModel, Column, String, UUID, GlobalSecondaryIndex, LocalSecondaryIndex, Engine, DateTime, Boolean, | |
Set |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask_restful import Resource | |
class UserProfileImageResource(Resource): | |
@jwt_required() | |
def post(self, user_id): | |
""" | |
/v1/users/<user_id>/signed_post | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is just an example of our current db and number of dups | |
*/ | |
SELECT | |
MobilePhone, count(MobilePhone) | |
FROM TerminalMemberTable | |
WHERE IsActive = 1 AND LastTransaction IS NOT NULL | |
GROUP BY MobilePhone | |
HAVING count(MobilePhone) > 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask_sqlalchemy import SQLAlchemy | |
from sqlalchemy.orm import validates | |
db = SQLAlchemy() | |
class User(db.Model): | |
__tablename__ = "user" | |
id = db.Column(db.Integer, primary_key=True) | |
first_name = db.Column(db.Unicode) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import distutils.spawn | |
import sys | |
import re | |
if '/usr/local/lib/python2.7/site-packages' not in sys.path: | |
sys.path.insert(0, '/usr/local/lib/python2.7/site-packages') |
NewerOlder