This file contains 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 { mergeProps } from "../helpers" | |
const tokens = { | |
"colors.red.500": { | |
value: "#f00", | |
}, | |
} | |
const utilities = { | |
bg: { | |
transform(value, { token, raw }) { |
This file contains 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 re | |
import dropbox | |
import os | |
from dropbox.files import DeleteArg | |
ACCESS_TOKEN = os.getenv("DROPBOX_ACCESS_TOKEN", "") | |
dbx = dropbox.Dropbox(ACCESS_TOKEN) | |
date_regex = r"\d{2}-\d{2}-\d{4}" |
This file contains 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
export const SAMPLEREQUEST = { | |
contactDetails: { | |
customerType: "parent", | |
title: "Mrs.", | |
firstName: "Adenike", | |
lastName: "Toluwani", | |
email: "[email protected]", | |
phone: "2347083266188", | |
vicinity: "Agungi", | |
region: "Lekki", |
This file contains 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
@receiver(p_signals.payment_verified) | |
def on_payment_verified(sender, ref, amount, order, **kwargs): | |
record = UserPayment.objects.filter(order=order).first() | |
record.made_payment = True | |
record.amount = Decimal(amount) / 100 | |
record.save() | |
# process to quickbooks | |
record.create_sales_receipt() | |
record.add_to_mailing_list() |
This file contains 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
def verify_payment(request, order): | |
amount = request.GET.get("amount") | |
txrf = request.GET.get("trxref") | |
paystack_instance = PaystackAPI() | |
response = paystack_instance.verify_payment(txrf, amount=int(amount)) | |
if response[0]: | |
p_signals.payment_verified.send( | |
sender=PaystackAPI, ref=txrf, amount=int(amount), order=order | |
) | |
return JsonResponse({"success": True}) |
This file contains 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
CMD gunicorn - workers=4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:5000 run:app - access-logfile - |
This file contains 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
@app.route('/aggregated-measurements') | |
def get_aggregated_measurements(): | |
aggregated_measurements_objects = AggregatedMeasurement.query.first() | |
# this is where the breakpoint would be | |
import pdb; pdb.set_trace() | |
# transforming into JSON-serializable objects | |
aggregated_measurement_schema = AggregatedMeasurementSchema() | |
result = aggregated_measurement_schema.dump(aggregated_measurements_objects) | |
return jsonify(result.data) |
This file contains 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
const steps = [ | |
{ | |
text: "Step 1: Personal Details", | |
display: true, | |
url: "personal-info", | |
completed: false | |
}, | |
{ | |
display: true, | |
text: "Step 2: Credentials & Education", |
This file contains 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
test("When there are two different keys and one needs updating", () => { | |
const page = [ | |
{ | |
Awards: { | |
awards: { | |
heading: "Awards & Certifications", | |
body: [ | |
{ | |
title: "Shell Ecomarathon Award", | |
company: "University of Lagos", |
This file contains 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 React from "react"; | |
import { render } from "react-dom"; | |
import Hello from "./Hello"; | |
const styles = { | |
fontFamily: "sans-serif", | |
textAlign: "center" | |
}; | |
class ChildComponent extends React.Component { |
NewerOlder