Skip to content

Instantly share code, notes, and snippets.

View joshuacrowley's full-sized avatar
🍐

Joshua Crowley joshuacrowley

🍐
View GitHub Profile
export const speakText = async (text: string, apiKey: string): Promise<void> => {
let ws: WebSocket | null = null;
let audioContext: AudioContext | null = null;
let mediaStreamDestination: MediaStreamAudioDestinationNode | null = null;
let scriptProcessorNode: ScriptProcessorNode | null = null;
let audioElement: HTMLAudioElement | null = null;
let buffer: Float32Array = new Float32Array();
const API_VERSION = "2024-06-10";
const SAMPLE_RATE = 44100;
@joshuacrowley
joshuacrowley / AppSyncAPI.yaml
Created November 8, 2018 03:39 — forked from adrianhall/AppSyncAPI.yaml
A CloudFormation template for DynamoDB + Cognito User Pool + AppSync API for the Notes tutorial
---
Description: AWS AppSync Notes API
Parameters:
APIName:
Type: String
Description: Name of the API - used to generate unique names for resources
MinLength: 3
MaxLength: 20
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$'
@joshuacrowley
joshuacrowley / buttonToggle.coffee
Last active May 12, 2017 16:48
Simple toggle button setup for Framer.js
toggleBatch = (arrayOfLayers) ->
for button in arrayOfLayers
button.states.add
off:
opacity: 0.30
index : 19
on:
opacity: 1
index : 20
button.states.switchInstant("off")
// https://www.dropbox.com/s/dn7d71xifq4ydw0/Screen%20Shot%202015-06-27%20at%204.35.47%20pm.png?dl=0
var allBoardSequences = ["01234 10423 24301 32140 43012", "01234 12340 20413 34021 43102" ..."01234 14302 23410 32041 40123"];
var playersMoveToSquare = 17;
var Boxes = 1,2,3,4,5...25
var tileColour = red;
var red = 1, blue = 2, yellow = 3, green = 4, purple = 5;
if (17 has red possiabilty) then ->
addTiles : function(gameToken, playerToken, tiles){
var unplayed = Tiles.find({
"gameToken": gameToken,
tileState: "unplayed",
"owner": "none",
}).fetch();
if (unplayed.length > 0){
var selected = _.first(unplayed, tiles);
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';