Skip to content

Instantly share code, notes, and snippets.

View im-aditya's full-sized avatar

Aditya im-aditya

View GitHub Profile
@tomduncalf
tomduncalf / example.js
Last active December 17, 2022 02:52
How to upload a local (iOS filesystem) file to S3 using React Native with temporary credentials
/**
* I recently needed to upload a file from the phone's filesystem to S3 using temporary credentials
* (i.e. access key, secret key and session token) issued by an API for a React Native application,
* without the overhead of Base64 encoding the file and passing it over the bridge (as it could be
* several MB big), and wanted to avoid writing native code to do this.
*
* None of the S3 libraries online worked with the temporary credentials, but I figured out a
* solution using the official AWS SDK (which is good, as it supports all the relevant authentication
* out of the box) and the react-native-fetch-blob module, which allows you to upload directly from the
* filesystem with the correct Content-type header (as far as I can tell, React Native's fetch only
@tanaikech
tanaikech / submit.md
Last active August 16, 2023 23:30
Selecting Files in Google Drive using Select Box for Google Apps Script

This is a sample script for selecting files in Google Drive using HTML select box for Google Apps Script.

Feature

Feature of this sample.

  • It is a simple and space saving.
  • When the folder is selected, the files in the folder are shown.
  • When the file is selected, the ID of file is retrieved. Users can use this ID at GAS.
  • When a folder is opened, all files in the folder are cached. By this, the second access of the folder is faster.
  • It doesn't retrieve all files in Google Drive at once, so the read of files from Google Drive becomes the minimum necessary.
@staltz
staltz / introrx.md
Last active July 2, 2024 03:45
The introduction to Reactive Programming you've been missing
@joaoffcosta
joaoffcosta / gist:5729398
Created June 7, 2013 13:49
How to use S3 browser upload using XMLHttpRequest
<html>
<head>
<title>S3 POST Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script>
var bucketName = 'MY_BUCKET_NAME';
var AWSKeyId = 'MY_AWS_KEY_ID';
var policy = 'MY_POLICY';
var signature = 'MY_SIGNATURE';