Skip to content

Instantly share code, notes, and snippets.

View codeyourwayup's full-sized avatar

FRANK GO codeyourwayup

View GitHub Profile
@codeyourwayup
codeyourwayup / git-rebase-todo
Created June 18, 2022 06:52 — forked from juniorbird/git-rebase-todo
Sample git rebase todo
pick 019325e 0.1.0
pick a4b689d Fetch all dependencies
squash 714a49d Matches keywords to Docker repos
pick d2d1ca3 parseDependencies returns an object of dependencies.
squash e3b6cd9 Clean up packageParser
squash 57acd67 Initial commit
squash 3f3e05e Rough out how we'll make Dockerfiles
squash 9e10b94 Can check for, make Docker files
squash a27b0ee Write docker files
pick a0980b8 Build Dockerfiles
@codeyourwayup
codeyourwayup / simulate_keypress.js
Created February 8, 2023 01:49 — forked from ejoubaud/simulate_keypress.js
Simulate keypress that works in Google nav in Chrome
// Based on http://stackoverflow.com/a/10520017/1307721 and http://stackoverflow.com/a/16022728/1307721
Podium = {};
Podium.keydown = function(k) {
var oEvent = document.createEvent('KeyboardEvent');
// Chromium Hack
Object.defineProperty(oEvent, 'keyCode', {
get : function() {
@codeyourwayup
codeyourwayup / recorder.html
Created March 4, 2023 10:14 — forked from liketaurus/recorder.html
How to record audio in client code and upload recording to AWS S3 bucket
<!-- https://medium.com/@bryanjenningz/how-to-record-and-play-audio-in-javascript-faa1b2b3e49b -->
<!-- https://docs.aws.amazon.com/en_us/sdk-for-javascript/v2/developer-guide/s3-example-photo-album.html -->
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.585.0.min.js"></script>
<script>
function uploadAWS(blob) {
var vaultBucketName = "[YOUR-BUCKET-NAME]";
var bucketRegion = "[YOUR-AWS-REGION]";
var IdentityPoolId = "[YOUR-IDENTITY-POOL-ID]";
@codeyourwayup
codeyourwayup / README.md
Created March 4, 2023 10:59 — forked from Dosant/README.md
AWS S3 to OpenAI Whisper via Node.js stream

Current (2023-03-01) OpenAI Whisper API expects a file uploaded as part of multipart/form-data in POST request. I initially struggled to use this API inside Node.js with an audio file stored inside an AWS s3 bucket, so I decided to share this snippet:

The API usage example from the OpenAI docs:

curl --request POST \
  --url https://api.openai.com/v1/audio/transcriptions \
  --header 'Authorization: Bearer TOKEN' \
 --header 'Content-Type: multipart/form-data' \