Skip to content

Instantly share code, notes, and snippets.

View kilokeith's full-sized avatar

keith kilokeith

View GitHub Profile
@benjaminmiles
benjaminmiles / ReactShareMedia.jsx
Last active February 20, 2024 17:09
Use the Web Share API to save and share a media file on supported mobile apps with a direct link fallback.
import React, { useCallback, useState, useEffect } from "react";
export async function mediaToBlob(src = "", mimetype = "video/mp4") {
// Fetch the media file as ArrayBuffer
const response = await fetch(src);
const mediaData = await response.arrayBuffer();
// Create a Blob from the video data
const blob = new Blob([mediaData], { type: mimetype });
@jimmywarting
jimmywarting / readme.md
Last active September 19, 2024 08:23
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@chrismdp
chrismdp / s3.sh
Last active September 13, 2024 12:53
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1