Skip to content

Instantly share code, notes, and snippets.

View revant's full-sized avatar

Revant Nandgaonkar revant

View GitHub Profile
@revant
revant / digital_signature.py
Created October 11, 2024 05:54
Frappe Framework and PyHanko digital signatures
# License: MIT
# Store signatures in "Digital Signature"
# it uploads signatures on S3 for secure storage.
# Code snippet to fetch signature and sign document
import io
import os
import ntpath
import boto3
import botocore.exceptions
@revant
revant / NOTES.md
Last active March 3, 2025 01:56
Advance frappe benches with Dokploy
@revant
revant / Dockerfile
Last active March 20, 2025 09:45
K3s in VS Code Devcontainer
FROM debian:bookworm-slim
COPY entrypoint.sh /entrypoint.sh
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
locales \
ca-certificates \
curl \
sudo \
@revant
revant / file_uploader.js
Last active April 18, 2025 00:30
Multi Part Upload for Frappe
// Copyright (c) 2025, Revant Nandgaonkar and contributors
// License: MIT
// HTML Field has following options
// <div id="dropzoneTarget" class="fallback dropzone"> <input hidden name="file" type="file"> </div>
frappe.ui.form.on('File Uploader', {
refresh(frm) {
const url = '/api/method/multipart_upload.upload.multipart_file_upload';
const chunkSize = 20 * 1024 * 1024; // 20MB