Skip to content

Instantly share code, notes, and snippets.

View ricardo-valerio's full-sized avatar

Ricardo Valério ricardo-valerio

View GitHub Profile
import argparse
parser = argparse.ArgumentParser(description='Process some Excel files and insert data into DB')
#---------------------------------------------------------
# Excell Args
#---------------------------------------------------------
parser.add_argument('-n', '--sheet_name', type=str, required=False,
help="name of the sheet to extract the data")
#!/usr/bin/python3
from openpyxl import load_workbook
workbook_file = load_workbook(filename="test_file_for_data_entry_automation.xlsx",
data_only=True,
read_only=True)
@ricardo-valerio
ricardo-valerio / circle_progression.py
Last active October 20, 2018 01:48
Circle Progression in Music Theory
#!/usr/bin/python3
from termcolor import colored
from time import sleep as wait_a_few_seconds_between_chords
scales = {
"C" : ["C" , "D" , "E" , "F" , "G" , "A" , "B" ],
"Db": ["Db", "Eb", "F" , "Gb", "Ab", "Bb", "C" ],
"D" : ["D" , "E" , "Gb", "G" , "A" , "B" , "Db"],
"Eb": ["Eb", "F" , "G" , "Ab", "Bb", "C" , "D" ],
@ricardo-valerio
ricardo-valerio / random_chords.py
Last active March 8, 2018 03:53
script that generates random chords for you to practice... An efficient alternative for dice rolling...
#!/usr/bin/python3
from random import choice
from termcolor import colored
from time import sleep as wait_a_few_seconds_between_chords
########################################################
# Feel free to comment/uncomment any key and quality
# that you want (or not) to practice...
########################################################
#!/usr/bin/python3
from platform import system as platform_name
from os import system
import ctypes
platforms_dictionary = {
"Windows": {
"open" : 'ctypes.windll.WINMM.mciSendStringW(u"set cdaudio door open", None, 0, None)',
"close": 'ctypes.windll.WINMM.mciSendStringW(u"set cdaudio door closed", None, 0, None)'
@ricardo-valerio
ricardo-valerio / django-project-made-right.py
Last active October 14, 2018 00:16
django project creation automatized (virtualenv, django installation and startproject)
#!/usr/local/bin/python3
from termcolor import colored
import clipboard
VIRTUALENV_NAME = input("Name for Virtual-Environment: ")
DJANGO_VERSION_TO_INSTALL = input("Django Version: ")
DJANGO_PROJECT_TO_CREATE = input("Project Name: ")
@ricardo-valerio
ricardo-valerio / django-environments-configuration.sh
Last active July 1, 2016 21:32
Terminal Commands for Django Virtual Environments Configuration
##########################################################################
# Ubuntu:
##########################################################################
# create virtual env
virtualenv <NAME-OF-DESIRABLE-ENV-DIRECTORY>
or
python3 -m venv --without-pip <NAME-OF-DESIRABLE-ENV-DIRECTORY>
# activate virtual env
@ricardo-valerio
ricardo-valerio / Default (OSX).sublime-keymap
Last active July 21, 2021 14:00
sublime text 2 keybinding to be able to move to the begin/end of line just like in sublime text 3
[
// go to beginning or end of the line
{ "keys": ["super+left"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["super+right"], "command": "move_to", "args": {"to": "eol", "extend": false} }
// move between empty lines with the alt key
{"keys": ["alt+up"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": false } },
{"keys": ["alt+down"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true } }