- example: using bash (aws cli sdk)
- example: using php (aws php sdk v3.*)
- you need to add example.com as custom auth provider in aws console (cognito/federated)
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>My Iframe</title> | |
| </head> | |
| <body> | |
| <button>Botão</button> | |
| <script type="text/javascript"> |
| 'use strict'; | |
| const crypto = require('crypto'); | |
| const AES_METHOD = 'aes-256-cbc'; | |
| const IV_LENGTH = 16; // For AES, this is always 16, checked with php | |
| const password = 'lbwyBzfgzUIvXZFShJuikaWvLJhIVq36'; // Must be 256 bytes (32 characters) | |
| function encrypt(text, password) { |
| // for multiple requests | |
| let isRefreshing = false; | |
| let failedQueue = []; | |
| const processQueue = (error, token = null) => { | |
| failedQueue.forEach(prom => { | |
| if (error) { | |
| prom.reject(error); | |
| } else { | |
| prom.resolve(token); |
| #!/bin/bash | |
| # Creator: Phil Cook | |
| # Modified: Andy Miller | |
| osx_major_version=$(sw_vers -productVersion | cut -d. -f1) | |
| osx_minor_version=$(sw_vers -productVersion | cut -d. -f2) | |
| osx_patch_version=$(sw_vers -productVersion | cut -d. -f3) | |
| osx_patch_version=${osx_patch_version:-0} | |
| osx_version=$((${osx_major_version} * 10000 + ${osx_minor_version} * 100 + ${osx_patch_version})) | |
| homebrew_path=$(brew --prefix) | |
| brew_prefix=$(brew --prefix | sed 's#/#\\\/#g') |
| class Client { | |
| static _instance | |
| static defaultHeaders = { 'Content-Type': 'application/json' } | |
| config = { | |
| baseUrl: '', | |
| urlHandler: (baseUrl, uri, query) => { | |
| var url = `${baseUrl}${uri}` | |
| if (uri.includes('://')) { | |
| url = uri |
| // Set from https://www.npmjs.com/package/@wordpress/scripts | |
| // Add package.json with the @wordpress/scripts dependency. | |
| // Add a root file called webpack.config.js | |
| // Import the original config from the @wordpress/scripts package. | |
| const defaultConfig = require( '@wordpress/scripts/config/webpack.config' ); | |
| // Import the helper to find and generate the entry points in the src directory | |
| const { getWebpackEntryPoints } = require( '@wordpress/scripts/utils/config' ); |
| "use client"; | |
| import { useState, useEffect, useRef } from "react"; | |
| function SimpleRecordButton() { | |
| const [isRecording, setIsRecording] = useState(false); | |
| const [audioStream, setAudioStream] = useState(null); | |
| const [mediaRecorder, setMediaRecorder] = useState(null); | |
| const [audioBlob, setAudioBlob] = useState(null); | |
| const [recordingTime, setRecordingTime] = useState(0); | |
| const timerRef = useRef(null); |