Skip to content

Instantly share code, notes, and snippets.

View furkanacaryes's full-sized avatar
👈
This guy tests.

Furkan Acar furkanacaryes

👈
This guy tests.
View GitHub Profile
@furkanacaryes
furkanacaryes / speech.py
Created January 6, 2021 14:49
Google Speech
"""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"
@furkanacaryes
furkanacaryes / translator.py
Created January 5, 2021 20:15
Google Translate Demo
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()
@furkanacaryes
furkanacaryes / install_pankod_cli_nightly.sh
Created February 6, 2020 18:08
Install Pankod CLI Nightly
git clone https://github.com/pankod/pankod-cli
cd ./pankod-cli
git checkout fix-leftover-issues
npm i && npm start
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}`);
@furkanacaryes
furkanacaryes / binding-this.js
Created January 9, 2020 12:29
Binding `this`
const external = function(sample) {
if (!!sample) this.beCool('I AM COOL!');
}
class Cool {
beCool(msg) {
console.log(msg);
}
run() {
@furkanacaryes
furkanacaryes / element.ts
Created November 18, 2019 12:03
Element Oriented Approach
// Element Oriented Approach
// # Class Component
import * as questions from '../path/to/questions';
import { createClassComponent } from '../path/to/factory';
export const ClassComponent = addElementCreator([
@furkanacaryes
furkanacaryes / ffmpeg_mp4s.sh
Last active October 25, 2019 12:37
FFmpeg downsize mp4s in directory
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
@furkanacaryes
furkanacaryes / webp-convert-directory.sh
Created June 2, 2019 14:39 — forked from tabrindle/webp-convert-directory.sh
Convert all files in directory to webp, with default params, or standard cwebp params passed from command
#!/bin/bash
PARAMS=('-m 6 -q 70 -mt -af -progress')
if [ $# -ne 0 ]; then
PARAMS=$@;
fi
cd $(pwd)