Skip to content

Instantly share code, notes, and snippets.

View zspine's full-sized avatar
🎯
Focusing

M#3 zspine

🎯
Focusing
View GitHub Profile
@zspine
zspine / Money.php
Created April 10, 2020 10:23
Doctrine brick money value object
<?php
namespace App\Entity\Embeddable;
use App\Model\Intl\MoneyInterface;
use Brick\Math\BigNumber;
use Brick\Math\Exception\NumberFormatException;
use Brick\Math\RoundingMode;
use Brick\Money\Context\CustomContext;
use Doctrine\ORM\Mapping as ORM;
@zspine
zspine / docker-compose.sh
Last active August 11, 2020 12:52
Frequently used fullstack developer commands
# DOCKER COMPOSE
####################################################################
docker-compose exec {CONTAINER_ID} sh
@zspine
zspine / QuasarStripeJs.vue
Last active May 8, 2022 01:40
Stripe integration with quasar (vue), uses custom form elements and error messages with quasar q-field
<template>
<div id="payment-form">
<div class="q-mt-md q-mb-md text-negative" v-if="submissionError">
<div id="card-errors" role="alert">{{ submissionError }}</div>
</div>
<q-field label="Card Number"
stack-label
class="q-mb-md"
@zspine
zspine / fastapi-magic.py
Last active November 10, 2023 02:16
Detecting File Mime Types in FastAPI Using the Python Magic Library
"""
Using `magic` library to detect the MIME type of uploaded files.
"""
from typing import Annotated
from fastapi import FastAPI, File, UploadFile, APIRouter
import magic
app = FastAPI()