Tom Leo's Blog

Home    Ask me anything    Submit a post

Web Developer from Boston, MA

February 21, 2019 at 8:49pm
2 notes

An excelent explination on the evolution of responsive design tequines in CSS over the years. Starting with basic word-wrapping of text, to break-points, to flex-box, and finally the CSS grid.

July 25, 2018 at 11:11am
0 notes

Install Python 3.7 on Ubuntu


tar xzvf Python-3.7.0.tgz
cd Python-3.7.0
./configure --enable-optimizations
make
altinstall

May 15, 2018 at 12:03pm
1 note

Make Frontend Shit Again →

The first website I ever made was geocities

memba berries

March 12, 2018 at 11:09am
0 notes

Batch Convert FLAC files to MP3 files

You can convert a flac file to mp3 via ffmpeg.

ffmpeg  -i "{}.flac" -c:v copy -q:a 0 "{}.mp3"

That command will need to be run for each flac file in a directory. To find files in a directory use the find command:

find ./ -maxdepth 1 \
        -type f \
        -iname '*.flac' \

One thing to note is that files with a ' in them will break when piping the outputs of find to xargs. To fix this you must add printf argument to find.

find ./ -maxdepth 1 \
        -type f \
        -iname '*.flac' \
        -printf '"%p"\n'

The printf arugment will ensure each file is quoted when being passed to xargs.

Next you’ll want to remove the file extension from the file, this can be done via sed.

sed -e 's/\.[^.]*$//' will find the everything from the last dot until the end of the file and replace it with nothing. i.e. "a.flac" will become "a.

To add back the ending quotation mark, simply substitude .flac" with " resulting in "a".

Finally we’ll want to take these find results and pass them into ffmpeg via xargs

find ./ -maxdepth 1 \
        -type f \
        -iname '*.flac' \
        -printf '"%p"\n' | sed -e 's/\.[^.]*$/\"/' | xargs -I '{}' \ 
        ffmpeg  -i "{}.flac" -c:v copy -q:a 0 "{}.mp3"

By removing the file extension via sed we were able to easily specify the intput and output files by adding the expected file extension.

Finally you can remove theh flac files with a similar method:

find ./ -maxdepth 1 -type f -iname '*.flac' -printf '"%p"\n' | xargs -I '{}' rm "{}"

January 23, 2018 at 10:15pm
0 notes

Which Programming Language Are You? - Eureka Software →

My least favorite language lol

(Source: eurekasoft.com)

January 16, 2018 at 3:00pm
0 notes

Tiny Wins →

Really interesting read about tiny out of band changes.

This was a one-line code change that took a few minutes… This tiny change
solved a seemingly small frustration, but it turned out to be very
significant to many of our users.

individual responses tell a story of how meaningful even the smallest tweak
can be to your users.

If there is even a slight inefficiency or frustration, it compounds with
every use. One confusing moment that takes an extra 5 seconds—repeated
multiple times a day in perpetuity—adds up to a lot of anxiety and wasted
time.

I noticed something weird about the issues we solved with these changes. They
were almost never reported.

Hundreds of people were ecstatic when we added that arrow to PR pages. Out of
those, not a single one indicated that this flow was confusing. A lot of
people assumed it was their own fault for not just “getting” it.

you can’t exclusively rely on existing user feedback and tickets. You need to
dig deeper.

December 28, 2017 at 12:46pm
0 notes

Using BrowserSync with Django


python manage.py runserver 0.0.0.0:8000
browser-sync start --proxy localhost:8000 --no-open --files "**/*.+(css|js|html)"

December 1, 2017 at 11:30am
0 notes

Advent Of Code 2017 Day 1

Advent Of Code 2017 has begun.

Here is my solution for day 1:
https://gitlab.com/tomleo/koans/blob/c83405b202d2d3837b09c73a01b8de3cdcacbbbd/advent-2017/day_01.py

October 13, 2017 at 8:01pm
1 note

astrada/google-drive-ocamlfuse →

Really Beautiful Library, I really should learn ocaml… or finish reading SCIP… or finish that Haskell book…

August 16, 2016 at 8:01pm
0 notes

The origins of hotmail

Random Though: My first ever email account was Hotmail. My sister helped me with the sign-up form. Later I switched to yahoo, and in highschool I was given an invitation to gmail.

Hotmail was released in 1996. The name was chosen because it included the letters HTML to emphasize it being ‘on the web’ (it was original stylized as ‘HoTMaiL’)

Hotmail was originally implemented using FreeBSD, but in a decision I’m sure every engineer regretted, it was moved to Windows 2000 after the service was bought by Microsoft.

Zack Bloom via https://eager.io/blog/history-of-email/