x
Desc set up.

My online log

Technology: Raspberry Pi, Git and web development.

Mead: Recipes and reviews.

Beer and more..

Remember PEP 8

12 Sep 2021 / Oscar F

How to remember PEP 8, the style guide for python code, whit a song by lemonsaur.

Pep 8

TL;DR

Whit help from the lyrics of the song I made a short TL;DR.

Tabs or Spaces?

4 spaces.

Imports

Avoid wildcard imports.

Whitespace in expressions and statements

Basically write compact code.

When to Use Trailing Commas

Trailing commas go behind list items.

Comments

Correct comments are important.

Naming Conventions

Constants should be named all capital letters and camelCase is not for Python

Programming Recommendations

Never use a bare exception.

Conclusion

A Foolish Consistency is the Hobgoblin of Little Minds

As PEP 20 says, "Readability counts".


The PEP8 Song

I think this song can help you remember Pep 8.

The lyrics to the song can be found below the video on Youtube.

A songification of that most holiest of Python Enhancement Proposals, the PEP 8.
Based on an idea by Daniel "Mr. Hemlock" Brown.
Written and performed by Leon Sandøy, A.K.A. lemonsaurus.
Music and melody from Mad World by Roland Orzabal.
This version was inspired by the version released by Gary Jules.
🌎 Website: https://lemonsaur.us/​


References:

https://www.python.org/dev/peps/pep-0008/

https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces

https://www.python.org/dev/peps/pep-0008/#imports

https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements

https://www.python.org/dev/peps/pep-0008/#when-to-use-trailing-commas

https://www.python.org/dev/peps/pep-0008/#comments

https://www.python.org/dev/peps/pep-0008/#naming-conventions

https://www.python.org/dev/peps/pep-0008/#programming-recommendations

https://www.youtube.com/watch?v=wNcobO-TAyY

Dessert In A Can - Neapolitan Ice Cream by Amundsen Brewery

01 Sep 2021 / Oscar F

Type: Stout - Imperial / Double Pastry
ABV: 10.5 %
Flavor: Fudge, vanilla, chocolate and coffee.
My rating: 4.5 / 5


Its fudge, vanilla and coffee.
First its a smell of sweet fudge but then there's a distinct hint of vanilla.
The taste is also fudge and vanilla but after a wile a taste of chocolate and coffee amerce and blend in.
The remaining taste is definitely coffee.
This is dessert on a can with coffee.


Untappd

Git housekeeping commands

06 Aug 2021 / Oscar F

TLDR: git branch -d <branch name> # Local "safe" delete

git checkout master

Local branches

git branch

Remote branches

git branch -r

Branches merged into checked out branch (master)

git branch --merged

Local "safe" delete

git branch -d <branch name 1> <branch name 2> ...
git branch --no-merge

Remote "unsafe" delete

git push --delete origin <branch name 1> <branch name 2> ...
git remote prune origin --dry-run

References:

[1]: medium.com/@milan.brankovic/git-housekeeping Retrieved: 6 August 2021 20:00 Git housekeeping

[2]: Git Reference Retrieved: 6 August 2021 20:00 Git Reference

Triple Berry Pie by Brewski

05 Jul 2021 / Oscar F

Type: Sour - Fruited Berliner Weisse

ABV: 4%

Flavor: Raspberry, vanilla, Fruity, Sour, Sweet

My rating: 4 / 5


Lots of pie and vanilla scent.

A reasonably thick and fine layer of foam.

Some nice sourness with raspberries and blueberry flavor.

It's a raspberry pie with vanilla.


Untappd

Belgian Abbey mead recipe

01 Maj 2021 / Oscar F

Required equipment:

  • 4.5-5 l Demijohn
  • 4.5-5 l stockpot
  • Hydrometer
  • Thermometer
  • Bung
  • Airlock

Good to have equipment:

  • Siphon
  • Funnel
  • Spoons

I used yeast Belgian Abbey M47 from mangrovejacks.com and vwp sterilizer.


To calculate the ABV you can use the formula:

(OÖ - FÖ) / 7.5 = ABV

OÖ: Original °Öchsle

FÖ: Final °Öchsle

My result: (70 - -5) / 7,5 = 10 ABV


Or this formula:

(OG - FG) x 131 = ABV

OG : Original Gravity

FG : Final Gravity

My result: (1.070 - 1,000 + 0.005) x 131 = 9,825 ABV


Ingredients:

  • 1,3 kg Honey
  • 3,5 l Water
  • 10 g Yeast

Instructions:

Wash the demijohn.

Fill the demijohn with water and sterilizer.

Wait 30 minutes.

Wash the stockpot.

Pour the sterilized water from the demijohn in the stockpot.

Wash two spoons, a funnel, a hydrometer, a thermometer, a bung and an airlock.

Put the equipment in the stockpot with the sterilized water.

Wait 30 minutes and rinse the equipment thoroughly and put them in a dish rack.

Dissolve the honey with 3,5 l new fresh spring water in the stockpot. If nessesary heat the water to a max ~32°C to dissolve the honey completely.

Wait for the honey water mix to cool down below 20°C and measure the gravity with a hydrometer. I got +70 °Öchsle ( = 1.070 Specific Gravity)

Pour the honey water mix in to the demijohn.

Pour the yeast in the demijohn and put on the bung with airlock.

Let it ferment for at least 4 weeks.

Measure the gravity with a hydrometer. I got -5 °Öchsle ( ~ -0.005 Specific Gravity)

Transfer into bottles. Drink, enjoy and scold in the company of good friends!