Skip to content

Instantly share code, notes, and snippets.

View danielduckworth's full-sized avatar

Daniel Duckworth danielduckworth

  • IEA
  • Melbourne, Australia
View GitHub Profile
sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) target
5.1 3.5 1.4 0.2 Iris-setosa
4.9 3.0 1.4 0.2 Iris-setosa
4.7 3.2 1.3 0.2 Iris-setosa
4.6 3.1 1.5 0.2 Iris-setosa
5.0 3.6 1.4 0.2 Iris-setosa
5.4 3.9 1.7 0.4 Iris-setosa
4.6 3.4 1.4 0.3 Iris-setosa
5.0 3.4 1.5 0.2 Iris-setosa
4.4 2.9 1.4 0.2 Iris-setosa
@danielduckworth
danielduckworth / caddy-global.md
Last active January 22, 2024 05:22
Caddy global options

Global options🔗

The Caddyfile has a way for you to specify options that apply globally. Some options act as default values; others customize HTTP servers and don't apply to just one particular site; while yet others customize the behavior of the Caddyfile adapter.

The very top of your Caddyfile can be a global options block. This is a block that has no keys:

{
	...
}
@danielduckworth
danielduckworth / blockly-terminal.ipynb
Last active July 17, 2023 11:21
Jupyter iframe with Blockly Terminal
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<title>example table</title>
@danielduckworth
danielduckworth / installcuda12.sh
Created September 22, 2023 12:50
Install cuda12 toolkit
wget https://developer.download.nvidia.com/compute/cuda/12.0.0/local_installers/cuda_12.0.0_525.60.13_linux.run
bash cuda_12.0.0_525.60.13_linux.run --no-drm --no-man-page --override --toolkitpath=~/local/cuda-12.0/ --toolkit --silent
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:~/local/cuda-12.0/lib64" >> ~/.bashrc
echo "export PATH=\$PATH:~/local/cuda-12.0/bin" >> ~/.bashrc
source ~/.bashrc
@danielduckworth
danielduckworth / README.md
Last active January 22, 2024 05:22
Conda env pack and move

Conda Pack n' Move

[WIP]

This shell script is used to transfer a Conda environment from one machine to another using rsync and SSH. It first checks if the correct number of arguments is provided, then installs conda-pack if it is not already installed. It then activates the specified Conda environment, packs it, transfers the tar file to the new directory using rsync, unpacks the environment via SSH on the remote machine, updates the .zshrc file, and reloads the shell.

Usage:

  1. Copy the file to ~/bin with cp condapack_n_move.sh ~/bin/condapack_n_move
  2. Make it executable with chmod +x ~/bin/condapack_n_move
@danielduckworth
danielduckworth / ImageExample.vue
Created October 28, 2023 04:38 — forked from TheBITLINK/ImageExample.vue
Material Design 3 (Material You) Theme Generator for Vuetify
<script setup lang="ts">
import { useTheme } from 'vuetify'
import { vuetifyThemeFromImage } from '@/plugins/vuetifyM3ThemeGenerator'
const theme = useTheme()
async function onImageLoad (e: Event) {
const target = e.target as HTMLImageElement
const darkTheme = await vuetifyThemeFromImage(target, true)
const lightTheme = await vuetifyThemeFromImage(target, false)
theme.themes.value.dark.colors = darkTheme.colors
@danielduckworth
danielduckworth / DirectusInput.tsx
Created November 1, 2023 15:47 — forked from izoukhai/DirectusInput.tsx
Generate forms from Directus CMS and render them with NextJS
"use client";
import { FieldValues, UseFormProps, UseFormReturn } from "react-hook-form";
import { ApiCollections } from "../../../@types/api";
export const DirectusInput = (props: {
element: ApiCollections["form_components"];
hookForm: UseFormReturn<FieldValues, any>;
}) => {
const { element, hookForm } = props;
@danielduckworth
danielduckworth / chromadb-cheatsheet.md
Last active October 23, 2024 06:09
Chromadb JS API Cheatsheet

Chromadb Javascript API Cheatsheet

💡 NOTE This is a quick cheatsheet of the API. For full API docs, refer to the JS and Python docs in the sidebar.

Run the backend

Run chroma run --path /db_path to run the Chroma backend as a standalone server on your local computer.

@danielduckworth
danielduckworth / vega-v5.json
Created November 9, 2023 05:05
Vega chart schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Vega Visualization Specification Language",
"definitions": {
"autosize": {
"oneOf": [
{
"enum": ["pad", "fit", "fit-x", "fit-y", "none"],
"default": "pad"
},