Skip to content

Instantly share code, notes, and snippets.

View hernamesbarbara's full-sized avatar

austin hernamesbarbara

View GitHub Profile
#!/usr/bin/env bash
# split a long mp3 into separate mp3s of equal length
# args:
# <input_mp3>: filename of the long mp3
# <n_parts>: how many shorter mp3s you want to cut the long one into
# ./splitmp3 long-mp3-audio.mp4 3 # -> gives you 3 output mp3s of equal length
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <input_mp3> <n_parts>"
exit 1
# -*- coding: utf-8 -*-
import subprocess
import os
# need to install Calibre e-book mgmt tool dependencies
# https://calibre-ebook.com/
# https://www.epubor.com/calibre-drm-removal-plugins.html
def kindle2pdf(kindle_file, output_directory):
"""
convert_webm_to_mp4() {
for file in *.webm; do
if [[ ! -e "$file" ]]; then
echo "No .webm files found in the current directory."
return 1
fi
local newfile="${file/.webm/.mp4}"
@hernamesbarbara
hernamesbarbara / places.py
Created August 31, 2023 23:09
fetch place_ids from google
#!/usr/bin/env python3
import os
import requests
import pandas as pd
ENDPOINTS = {
"/search": {"url": "https://maps.googleapis.com/maps/api/place/findplacefromtext/json", "params": ["input", "inputtype", "fields"]},
"/details": {"url": "https://maps.googleapis.com/maps/api/place/details/json", "params": ["place_id", "fields"]}
}

install these libs


pip3 install -r reqs.txt

then you can run the script on the test img file like so

#!/usr/bin/env bash
# -*- coding: utf-8 -*-
filename=$(basename -- "$1")
extension="${filename##*.}"
filename="${filename%.*}"
ffmpeg -i "$1" \
-vf scale=-1:720\
-c:v libx264\

installed the package

brew install imagemagick

Test that it worked

# imagemagick ships w/ a few default images
readData = () ->
rawJson = Utils.domLoadDataSync "data.json"
return JSON.parse rawJson
# recursively clone an object
clone = (obj) ->
return obj if obj is null or typeof (obj) isnt "object"
temp = new obj.constructor()
for key of obj
@hernamesbarbara
hernamesbarbara / README.md
Last active October 20, 2018 20:21
fetch any mailto email addresses found on a web page

basic script to extract any email addresses from a website that can be found

usage

get all emails you can find from this page:

http://zombierecords.com/staff

import numpy as np
import pandas as pd
def make_random_dataframe(ncol, nrow):
"return a random dataframe suitable for simulating a linear regression"
from string import ascii_lowercase as letters
from sklearn.datasets import make_regression
columns = list(letters[:ncol])
X, y = make_regression(n_features=ncol-1, n_samples=nrow, n_targets=1, n_informative=4)
y = y.reshape(X.shape[0], 1)