Skip to content

Instantly share code, notes, and snippets.

View jacobtomlinson's full-sized avatar

Jacob Tomlinson jacobtomlinson

View GitHub Profile
@jacobtomlinson
jacobtomlinson / README.md
Last active October 28, 2022 11:41
Recording textual demos with vhs

Install vhs.

$ conda create -n textual-demo python=3.10 -y

$ conda activate textual-demo

$ pip install textual

$ vhs < demo.tape
@jacobtomlinson
jacobtomlinson / minikube-update-hosts.sh
Last active October 26, 2022 15:50
A script to update your /etc/hosts file from minikube ingest records
#!/bin/bash
#
# A script to update your /etc/hosts file from minikube ingest records
#
# Installation
# ------------
# curl -L https://gist.github.com/jacobtomlinson/4b835d807ebcea73c6c8f602613803d4/raw/minikube-update-hosts.sh > /usr/local/bin/minikube-update-hosts
# chmod +x /usr/local/bin/minikube-update-hosts
set -e
@jacobtomlinson
jacobtomlinson / remove_empty_folders.py
Last active October 19, 2022 04:56
Python Recursively Remove Empty Directories
#! /usr/bin/env python
'''
Module to remove empty folders recursively. Can be used as standalone script or be imported into existing script.
'''
import os, sys
def removeEmptyFolders(path, removeRoot=True):
'Function to remove empty folders'
if not os.path.isdir(path):
@jacobtomlinson
jacobtomlinson / Introduction_to_Dask_with_RAPIDS.ipynb
Last active July 20, 2022 17:04
Intro to distributed computing on GPUs with Dask in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jacobtomlinson
jacobtomlinson / notebook.ipynb
Last active March 11, 2022 17:40
Launch a hybrid CPU and GPU Dask cluster and use annotations to pin work to specific hardware
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jacobtomlinson
jacobtomlinson / poke.py
Created January 6, 2022 14:36
Poke Dask dashboard
# A script that gives a local Dask cluster something to do without stressing hardware.
# Useful for testing the dashboard.
import time
from dask_ctl import get_cluster
from dask.distributed import Client, wait
from dask import delayed
@jacobtomlinson
jacobtomlinson / sun.py
Created January 8, 2020 08:30
Opsdroid Home Assistant sun lights
from opsdroid_homeassistant import HassSkill, match_sunrise, match_sunset
class SunriseSkill(HassSkill):
@match_sunset
async def lights_on_at_sunset(self, event):
await self.turn_on("light.outside")
@match_sunrise
@jacobtomlinson
jacobtomlinson / config.yaml
Created January 8, 2020 08:55
Opsdroid Home Assistant example config
## Set the logging level
logging:
level: info
## Show welcome message
welcome-message: true
## Connector modules
connectors:
homeassistant:
@jacobtomlinson
jacobtomlinson / 2020-02-03 Azure UCX-Py Testing.ipynb
Last active September 27, 2021 11:06
UCX-Py testing on Azure
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jacobtomlinson
jacobtomlinson / Dask CuPy cuDF Example.ipynb
Created February 11, 2020 16:02
Example of using CuPy and cuDF with Dask CUDA
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.