Skip to content

Instantly share code, notes, and snippets.

View srivatsav's full-sized avatar

sri vatsav srivatsav

  • Hyderabad,India
View GitHub Profile
{
"public_identifier": "sri-vatsav-3344666b",
"profile_pic_url": "https://s3.us-west-000.backblazeb2.com/proxycurl/person/sri-vatsav-3344666b/profile?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=0004d7f56a0400b0000000001%2F20240411%2Fus-west-000%2Fs3%2Faws4_request&X-Amz-Date=20240411T053147Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=b7233d575c75273f64f2d04b2a51d84c008908c81a020b89b511a08b880ee521",
"background_cover_image_url": "https://s3.us-west-000.backblazeb2.com/proxycurl/person/sri-vatsav-3344666b/cover?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=0004d7f56a0400b0000000001%2F20240411%2Fus-west-000%2Fs3%2Faws4_request&X-Amz-Date=20240411T053147Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=87bf34552ae3e8184429b1689be2436bfbb178ccd4bc5337cf92393cdb86f080",
"first_name": "sri",
"last_name": "vatsav",
"full_name": "sri vatsav",
"follower_count": 923,
"occupation": "Product Development Engineer - III at Phenom",
"headline": "Product Development En
@srivatsav
srivatsav / file-stream-splitter.js
Created October 14, 2021 13:45
File Stream Splitter.
const fs = require("fs");
const splitFileReadStream = (readStream, maxFileSize, filePath, callback) => {
if(maxFileSize <= 0) {
throw new Error("Invlaid file size.")
}
const fileChunks = [];
const outputStream = (splitOffset) => {
@srivatsav
srivatsav / blob-to-base64-converter.js
Created October 15, 2019 13:31
Blob to base64 converter
<View style={{ flex: 1 }}>
<Button
title="download"
onPress={() => {
fetchFileAsPdf({...request})
.then((response) => {
// create a new file reader.
const fileReader = new FileReader();
// use readAsDataURL to read the contents of a Blob/File.
fileReader.readAsDataURL(response);