Skip to content

Instantly share code, notes, and snippets.

View timkofu's full-sized avatar
💭
💭

Timothy Makobu timkofu

💭
💭
View GitHub Profile
@timkofu
timkofu / install_facetimehd_driver.sh
Last active April 19, 2024 12:38
Linux FacetimeHD Driver Install.
#!/bin/bash
# Ref: https://gist.github.com/johnjeffers/3006011ec7767a4101cdd118e8d64290
# status: working
WORKING_DIRECTORY=$HOME/Downloads/facetimehd_driver
if [ ! -d "$WORKING_DIRECTORY" ]; then
mkdir "$WORKING_DIRECTORY"
fi
@timkofu
timkofu / check_mail.py
Last active July 27, 2023 08:39
Do I have mail?
#!/bin/env python
"""
Retrieve number and subjects of unread mail from Gmail.
External dependencies:
Set a GMAIL_LOGIN environment variable as a json string with Gmail access credentials.
An example in Zsh:
export GMAIL_LOGIN='{"username":"you@gmail.com", "password":"app_password"}'
Usage example:
@timkofu
timkofu / test_coverage_elif_branching.py
Created September 23, 2022 10:42
Test coverage.py elif branching.
## requirements.pip
# pytest
# pytest-cov
# black
## .coveragerc
# [run]
# branch = True
# [report]
# skip_covered = True
@timkofu
timkofu / pom.xml
Created August 11, 2021 10:11
Minimal Maven configuration that will generate a working Jar.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>name.makobu.project</groupId>
<artifactId>project</artifactId>
<version>0.1.0</version>
<name>project</name>
# Date: 13/07/2021
# Author: @timkofu
# Description: GitHib Copilot test drive
from typing import Callable
import big_o # https://pypi.org/project/big-O/
def sorter(sorter: Callable[[list[int]], list[int]], range: int) -> str:
class UniqueItems(list):
def append(self, item):
if item not in self:
super(UniqueItems, self).append(item)
import random
from wordcloud import WordCloud
import matplotlib.pyplot as plt
word_cloud_text = []
for word in ['Rust','Go','Java','C++', 'Erlang','D', 'Python']:
for _ in range(random.randint(1000, 10000)):
word_cloud_text.append(word)
#!/bin/bash
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
@timkofu
timkofu / random_password.py
Created April 16, 2019 09:49
Random password generator
#!/usr/bin/env python
import random
import string
def generate_random_password():
""" Generate 21 character random password """
selection = string.ascii_letters + string.digits + "#$%&@"
@timkofu
timkofu / ffmpeg_audiovideo_sync.sh
Last active April 3, 2019 10:32
Fix video:audio sync with ffmpeg
ffmpeg -i video_file.mp4 -itsoffset 0.1 -i video_file.mp4 -map 0:0 -map 1:1 -acodec copy -vcodec copy synced.mp4