Skip to content

Instantly share code, notes, and snippets.

View gbozee's full-sized avatar
🎯
Focusing

Abiola gbozee

🎯
Focusing
View GitHub Profile
import { mergeProps } from "../helpers"
const tokens = {
"colors.red.500": {
value: "#f00",
},
}
const utilities = {
bg: {
transform(value, { token, raw }) {
@gbozee
gbozee / app.py
Created May 25, 2022 07:19
Delete dropbox files
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}"
@gbozee
gbozee / Search query structure.js
Last active February 16, 2021 09:52
Search result snapshot
export const SAMPLEREQUEST = {
contactDetails: {
customerType: "parent",
title: "Mrs.",
firstName: "Adenike",
lastName: "Toluwani",
email: "[email protected]",
phone: "2347083266188",
vicinity: "Agungi",
region: "Lekki",
@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()
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})
@gbozee
gbozee / Dockerfile
Created October 23, 2018 05:04
Django meets Async
CMD gunicorn - workers=4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:5000 run:app - access-logfile -
@gbozee
gbozee / stackoverflow.py
Created May 2, 2018 08:42
Sample Question
@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)
const steps = [
{
text: "Step 1: Personal Details",
display: true,
url: "personal-info",
completed: false
},
{
display: true,
text: "Step 2: Credentials & Education",
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",
@gbozee
gbozee / scenario1.js
Last active February 22, 2018 20:06
Buggy Case
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 {