Skip to content

Instantly share code, notes, and snippets.

View crypto-jeronimo's full-sized avatar

Crypto Jerônimo crypto-jeronimo

View GitHub Profile
@crypto-jeronimo
crypto-jeronimo / change_tempo.sh
Created May 28, 2018 10:06
Change audio clip tempo
ffmpeg -i "<original_audio_clip>" -filter:a "atempo=<target_tempo>" "<target_audio_clip>"
# where `<target_tempo>` should be < 1 for slower tempo, and > 1 (e.g., 1.4) for faster tempo
@crypto-jeronimo
crypto-jeronimo / tts.py
Created April 11, 2018 19:43
Text-to-Speech generation in Python
# Requires: gtts
# $ pip install --user --upgrade gtts
from gtts import gTTS
tts = gTTS(text='Hi! My name is Xora. Nice to meet you all!', lang='en-us', slow=False)
tts.save("xora_intro.mp3")
@crypto-jeronimo
crypto-jeronimo / import_submodules.py
Created April 8, 2018 14:57
Dynamically load all Python submodules
import pkgutil, importlib, sklearn, sys
def import_submodules(package_name):
""" Import all submodules of a module, recursively
:param package_name: Package name
:type package_name: str
:rtype: dict[types.ModuleType]
"""
@crypto-jeronimo
crypto-jeronimo / rename-github-repo.md
Created March 17, 2018 13:19
Rename GitHub repository

Update on GitHub

  1. Navigate to the "Admin" page for the repository you wish to rename.
  2. Change the Repository Name and click on the "Rename" button.
  3. GitHub will present you with a warning dialog. You should pay attention to this if you are renaming a repository shared by multiple people. In case you're the only committer, you can safely ignore the warning.

Update local copy: Option #1

  1. Remove the local copy entirely.
  2. Re-clone the repository.
@crypto-jeronimo
crypto-jeronimo / update-fork.md
Last active March 17, 2018 13:15
Bring a fork up-to-date with main repository

Originally retrieved from here.

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo

git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git