Skip to content

Instantly share code, notes, and snippets.

View eugenius1's full-sized avatar

Eusebius Ngemera eugenius1

View GitHub Profile
@eugenius1
eugenius1 / tree_node_with_bounds.cpp
Created September 22, 2024 21:08
Tree node with bounds
/*
* Eusebius Ngemera
* EE2 Data Structures 2015
*/
#include <iostream>
using namespace std;
struct treeNode{
@eugenius1
eugenius1 / resume.json
Last active July 19, 2024 16:22
My resume.json
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Eusebius Ngemera",
"label": "Senior Software Engineer",
"image": "",
"email": "esebi95@gmail.com",
"phone": "",
"url": "https://eusebius.tech/projects",
"summary": "Hey there, I'm a Senior/Lead Software Engineer with years of professional experience especially with Go, C++ and Python. I'm also proficient in React, JavaScript, TypeScript, PostgreSQL, Docker and AWS. I have 2 years of experience in a FinTech startup and 4 years in the travel industry on high-performance applications.\n\nI'm on a sabbatical break and available to start work from September 2024.\n\nMore about me:\n- Worked in both large corporations and small, fast startups.\n- As a technical lead I push for code quality, data-driven decisions and knowledge-sharing among engineers.\n- Passionate about bringing value to the world through technology, especially developing countries.\n- I have a blog incl

Keybase proof

I hereby claim:

  • I am eugenius1 on github.
  • I am esebi (https://keybase.io/esebi) on keybase.
  • I have a public key ASCrrJ0dqlZy83VDWPANK2-WQ_S1BBGND_BqfLmuZwWeYQo

To claim this, I am signing this object:

@eugenius1
eugenius1 / objArrayToCsv.js
Last active November 9, 2020 23:46
Object Array to CSV, with optional header & escaped comma & double-quotes
// Inspired by https://stackoverflow.com/a/11257124/5288481
// Assumes all objects have the same keys
function objArrayToCsv(objArray, header=true) {
// parse to object if not already one
let array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;
let str = '';
// header row
if (header && array.length >= 1) {
let line = '';
@eugenius1
eugenius1 / customisations.tex
Last active May 30, 2017 13:06
My LaTeX customisations - minted, ceiling & floor, et al., image directory
\usepackage[super]{nth}
% code with syntax highlighting
\usepackage{minted}
\usemintedstyle{}
\setminted[C]{
tabsize=4,
linenos=true,
frame=lines,
fontsize=\footnotesize
@eugenius1
eugenius1 / README.md
Last active April 28, 2017 14:28
Aligned row of native Social Sharing buttons with counts (and robust Accessibility)

Demo here.

Shows a row of native social sharing buttons with counts, for Twitter, Facebook, Google+ and LinkedIn. Sharing is still possible without JavaScript and also in text-only modes, via url APIs. Uses Bootstrap for column placement.

On mobile phone screens (xs), the row becomes two rows with one button on each.

On UNIX, see the text-only experience with terminal command lynx http://eusebius.tech/#social-share-buttons

Replace EusebiusTech in Twitter with your own hashtags. %23 is the url encoding of #. See docs for more info.

@eugenius1
eugenius1 / all_subsets.py
Last active January 24, 2017 23:37
All subsets of a list
def all_subsets(arr):
"""Returns a list of all subsets of a given list.
Mathematically: a set of all subsets of a set
Notes:
- Duplicates are treated distinct, i.e no duplicate checking or filtering.
- Recursive implementation.
"""
set_length = len(arr)
@eugenius1
eugenius1 / parallelAccumulate.cpp
Last active November 25, 2016 04:44
Parallel Accumulate using tbb::parallel_reduce
#include <numeric> // std::accumulate
#include "tbb/parallel_reduce.h"
#include "tbb/blocked_range.h"
template <class Summable, class SummableIt>
Summable parallelAccumulate(
SummableIt beginIt,
SummableIt endIt,
const Summable initial
) const {
@eugenius1
eugenius1 / new-cw.sh
Last active November 2, 2016 02:46
Imperial EEE HPCE coursework - new git repo folder
#!/bin/bash
# 1. Store this in your HPCE folder, i.e ~/Documents/EEE/4/HPCE
# 2. Fill in your Imperial login below, no spaces
# 3. Invoke with `bash ./new-cw.sh 1` (without quotes and where 1 is the new coursework number)
ic_login=xyz89
if [ ! "$1" ]
then
echo "You forgot the coursework number. Goodbye"
exit
@eugenius1
eugenius1 / compress-img.sh
Last active July 31, 2016 02:02
Compress all JPG's in a folder to another folder
# http://www.imagemagick.org/script/command-line-processing.php#geometry
# http://stackoverflow.com/questions/7261855/recommendation-for-compressing-jpg-files-with-imagemagick
# run from raw/
cd raw/
for pic in img/covers/*.jpg;
do convert -strip -quality 80% -interlace Plane -gaussian-blur 0.05 -resize "1920>" "$pic" "../$pic";
done