Skip to content

Instantly share code, notes, and snippets.

View hexvolt's full-sized avatar

Eugene hexvolt

  • Toronto, Canada
View GitHub Profile
@hexvolt
hexvolt / utils.py
Created October 28, 2019 00:31
insert note to google spreadsheet
from gspread.urls import SPREADSHEETS_API_V4_BASE_URL
def insert_note(worksheet, label, note):
"""
Insert note ito the google worksheet for a certain cell.
Compatible with gspread.
"""
spreadsheet_id = worksheet.spreadsheet.id
class Account(models.Model):
client = models.ForeignKey(Client, related_name='client')
transactions = models.ManyToManyField('Transaction')
name = models.CharField(max_length=150, unique=True, null=True, blank=True)
currency = models.ForeignKey('Currency', related_name='currency')
is_usd_account = models.BooleanField(default=False)
created = models.DateTimeField(auto_now_add=True)
sudo apt-get -y install libbz2-dev liblzma-dev libsqlite3-dev libncurses5-dev libgdbm-dev zlib1g-dev libreadline-dev libssl-dev tk-dev build-essential libncursesw5-dev libc6-dev openssl
./configure
make
make test
sudo make altinstall
@hexvolt
hexvolt / get-audio.py
Created January 29, 2017 20:31
Small script to get the .mp3 pronunciations of the phrases specified in the .csv file
import csv
from gtts import gTTS
from tempfile import TemporaryFile
FILE_NAME = '{{input_file_name}}.csv'
def main():
with open(FILE_NAME, 'r') as input_file:
@hexvolt
hexvolt / .bashrc
Last active October 12, 2016 09:33
Aliases for .bashrc to find Raspberry. Note: MAC addresses of adaptors are there
alias find-pi-wifi="sudo nmap -sP 192.168.1.0/24 | awk '/^Nmap/{ip=\$NF}/00:E0:4D/{print ip}'"
alias find-pi="sudo nmap -sP 10.50.0.0/24 | awk '/^Nmap/{ip=\$NF}/B8:27:EB/{print ip}'"
@hexvolt
hexvolt / Compile and install ffmpeg on Raspberry 2 (Jessie)
Last active August 20, 2016 13:19
Compile and install ffmpeg on Rapberry (Jessie)
1. Get the dependencies:
sudo apt-get update
sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libtheora-dev libtool libvorbis-dev pkg-config texinfo texi2html zlib1g-dev libmp3lame-dev libx264-dev yasm git sudo apt-get install libopus-dev
mkdir ~/ffmpeg_sources
2. Get and install libvpx (required to make ffmpeg support .webm format)
cd ~/ffpeg_sources