View compressor.js
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
function addCompressor(el) { | |
var AudioContext = window.AudioContext || window.webkitAudioContext; | |
var context = new AudioContext(); | |
var source = context.createMediaElementSource(el); | |
var compressor = context.createDynamicsCompressor(); | |
var makeupGain = context.createGain(); | |
// Set compressor params here | |
compressor.threshold.value = -40; | |
compressor.knee.value = 40; |
View fout_test.py
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
#!/usr/bin/env python | |
filename = "output.txt" | |
with open(filename, 'w') as fout: | |
x = 0 | |
for x in range(5): | |
fout.write(""" def function_number{}(): \n | |
""".format(x)) |
View simple_convolution.py
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
#!/usr/bin/env python | |
import numpy as np | |
import cv2 | |
from scipy.signal import convolve2d | |
from skimage import color, data, restoration | |
import console | |
# read input | |
frame = cv2.imread("input.jpg").astype(np.float32) / 255.0 |
View make_audiobook.py
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
#!/usr/bin/env python3 | |
""" | |
To use: | |
1. install/set-up the google cloud api and dependencies listed on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/texttospeech/cloud-client | |
2. install pandoc and pypandoc, also tqdm | |
3. create and download a service_account.json ("Service account key") from https://console.cloud.google.com/apis/credentials | |
4. run GOOGLE_APPLICATION_CREDENTIALS=service_account.json python make_audiobook.py book_name.epub | |
""" | |
import re | |
import sys |