This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Synthesizes speech from the input string of text or ssml. | |
Note: ssml must be well-formed according to: | |
https://www.w3.org/TR/speech-synthesis/ | |
""" | |
from google.cloud import texttospeech | |
from playsound import playsound | |
import os | |
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "service-account.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from google.cloud import translate | |
from decouple import config | |
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "service-account.json" | |
def translate_text(text): | |
client = translate.TranslationServiceClient() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/pankod/pankod-cli | |
cd ./pankod-cli | |
git checkout fix-leftover-issues | |
npm i && npm start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mediaFilesJSON from "../../static/mediaFiles.json"; | |
export const AssetHelper = { | |
use(what) { | |
const match = mediaFilesJSON.find(({ name }) => name === what); | |
if (!match) throw new Error(`No asset found with name '${what}'`); | |
require(`../../static/${match.path}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const external = function(sample) { | |
if (!!sample) this.beCool('I AM COOL!'); | |
} | |
class Cool { | |
beCool(msg) { | |
console.log(msg); | |
} | |
run() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Element Oriented Approach | |
// # Class Component | |
import * as questions from '../path/to/questions'; | |
import { createClassComponent } from '../path/to/factory'; | |
export const ClassComponent = addElementCreator([ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ~/.bash_profile | |
for VIDEO in $(ls *.mp4); | |
do | |
echo "Converting $VIDEO using ffmpeg with flag 'crf' set to 28 ..." | |
ffmpeg -i "$VIDEO" -color_primaries 1 -color_trc 1 -colorspace 1 -vcodec libx264 -crf 28 -loglevel -8 -hide_banner "${VIDEO/%.mp4/_compressed.mp4}" | |
done | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PARAMS=('-m 6 -q 70 -mt -af -progress') | |
if [ $# -ne 0 ]; then | |
PARAMS=$@; | |
fi | |
cd $(pwd) |