Skip to content

Instantly share code, notes, and snippets.

View komuw's full-sized avatar

Komu Wairagu komuw

View GitHub Profile
@komuw
komuw / price_of_solar_panel.py
Last active August 12, 2026 09:50
price of solar
# How many units of KPLC do you use per month?
# Go to https://www.stimatracker.com/, click on `prepaid`, then enter amount in KES you use per month.
# Click `calculate`, it will give you your consumption in kwh. Mine is KES 5000, which give ~150kwh
monthly_kplc_cost = 5000 # KES
price_per_kwh = 33 # kes per unit
consumption_per_month = int(monthly_kplc_cost/price_per_kwh) # kWh
assert consumption_per_month == 151 # kwh
consumption_per_month = 150 * 1000 # watt-hours
@komuw
komuw / sgr_train.txt
Last active August 3, 2026 12:15
SGR net present value. Presentation by IEA Kenya.
- https://x.com/IEAKenya/status/1942493018717614531
- https://youtu.be/lZLN1Tbgyec?t=680
phase 1 2017, npv 3.8b usd.
phase 2 2019, npv 1.24b usd (in 2017 dollars)
npv phase 1 & 2. 5.1b usd(in 2017 dollars)
15years
future value investment.
@komuw
komuw / spending.py
Last active July 30, 2026 21:04
cost/spending of public primary, jss and secondary education in kenya
# we are going to try estimate the amount of money the govt(ahem, taxpayer) spends per public school student per year/term.
# We are only interested in the figures for students in PUBLIC primary, jss AND secondary schools.
# All the figures here come from the 2024/25 supplementary estimates I.
# see: https://mwangocapital.com/wp-content/uploads/2024/07/fy-24-25-supplementary-1-.pdf
# aka, the one that was sent to parliament after the 2024/25 finance bill was rejected.
# 2025/26
# https://www.treasury.go.ke/budget-books
# https://www.parliament.go.ke/budget-books-fy-2026-2027
# https://www.treasury.go.ke/budget-books-1/
@komuw
komuw / guide.txt
Last active September 2, 2025 17:54
Book summary: Finally Focussed by Dr. James Greenblatt MD.
Book: Finally Focussed by Dr. James Greenblatt MD.
Checkout: https://examine.com/ , no ads, non-industry affliated review of supplements backed by research
Checkout: https://consumerlab.com , no ads, non-industry affliated review of supplements backed by research
Checkout: https://www.webmd.com/vitamins/index
Nutrient Reference Value(NRV): are used to express the nutritional value of a food product as a percentage of the daily recommended intake for an average adult. It is by the European Food Safety Authority.
A. Magnesium/vitamin b6 guide.
1. Mg(glycinate,citrate,gluconate,l-threonate, but NOT oxide). Under 6yrs: 10mg daily in liquid form.
Liquid ionic magnesium from New beginnings co.
@komuw
komuw / xyz.py
Last active July 24, 2025 11:22
xyz.py
# - OOPs helps users to understand the software easily,dont need to know actual implementation.
# - increase readability, maintainability of code.
# - Procedural programming specifies the steps a program must take to reach the desired state, usually read in order from top to bottom.
# (a) encapsulation - bundling up attributes & methods that operate on data into a single unit(eg, class)
# (b) abstraction - showing only essential info, hide implementation detail.
# (c) inheritance - derived class can inherit properties and behaviour
# (d) polymorphism - ability of obj to take many forms. different classes can be treated as an obj of a common type.
# access specifiers: public, private, etc
@komuw
komuw / how to properly install virtualbox on chromebook
Last active June 16, 2025 16:12
how to properly install virtualbox on chromebook.
Taken from:https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-(x86)
https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-(x86)
only pasted here so I can be sure I will always have it.
NB: do this ALTERNATIVE INSTEAD(it solves multi reboots on vagrant up)
1. build kernel headers as per this diff method: https://github.com/divx118/crouton-packages/blob/master/README.md
ie: from a shell in ua chroot(ubuntu)
$ cd ~
$ wget https://raw.githubusercontent.com/divx118/crouton-packages/master/setup-headers.sh
@komuw
komuw / aba.md
Last active March 22, 2025 16:03
aba

course: https://edslearning.thinkific.com

  1. module 1: overview of autism and how ABA is used.
  2. module 2: science of ABA and principles used to make change.
  3. module 3: measurement and data collection. Without data, its hard to know if we are makin a difference.
  4. module 4: skill assessment. So as to know learners areas of weakness & strengths.
  5. module 5: different methodologies used to teach ABA.
  6. module 6: abhorrent behaviours and ways of reducing them.
  7. module 7: documentation and reporting requirements.
@komuw
komuw / kenya_electricity_power.py
Last active February 24, 2025 08:19
kenya electricity power back of envelope stats
# These statistics, figures and projections are back of the envelope
# see; https://en.wikipedia.org/wiki/Back-of-the-envelope_calculation.
# Do not rely on them for serious matters.
# But they should mostly be relatively accurate.
import math
# According to EPRA(Energy and Petroleum Regulatory Authority)
# See: https://www.epra.go.ke/sites/default/files/2024-10/EPRA%20Energy%20and%20Petroleum%20Statistics%20Report%20FY%202023-2024_2.pdf
peak_demand_for_electricity_in_year_2020 = 1880 # megawatt. This was in july 2020