Based on: https://gist.github.com/kevin-smets/8568070
This gist outlines the steps needed to setup zsh, ohmyzsh and the powerlevel10k theme, available for anyone to follow.
-
Setup required dependencies
# update packages sudo apt update
| import { getSupabaseBrowserClient } from "@midday/supabase/browser-client"; | |
| import { getUserDetails } from "@midday/supabase/queries"; | |
| import { upload } from "@midday/supabase/storage"; | |
| import { useState } from "react"; | |
| export function useUpload() { | |
| const supabase = getSupabaseBrowserClient(); | |
| const [isLoading, setLoading] = useState(false); | |
| const uploadFile = async ({ bucketName, file, path }) => { |
| import { SupabaseClient } from "@supabase/auth-helpers-nextjs"; | |
| type UploadParams = { | |
| file: File; | |
| path: string; | |
| }; | |
| export async function upload( | |
| client: SupabaseClient, | |
| { file, path }: UploadParams, |
| "use client"; | |
| import { useUpload } from "@/hooks/useUpload"; | |
| import { getSupabaseBrowserClient } from "@midday/supabase/browser-client"; | |
| import { useDropzone } from "react-dropzone"; | |
| export function Attachments({ id }) { | |
| const supabase = getSupabaseBrowserClient(); | |
| const [files, setFiles] = useState<Attachment[]>([]); | |
| const { isLoading, uploadFile } = useUpload(); |
Based on: https://gist.github.com/kevin-smets/8568070
This gist outlines the steps needed to setup zsh, ohmyzsh and the powerlevel10k theme, available for anyone to follow.
Setup required dependencies
# update packages
sudo apt update
| #!/bin/sh | |
| # Cleanup docker files: untagged containers and images. | |
| # | |
| # Use `docker-cleanup -n` for a dry run to see what would be deleted. | |
| untagged_containers() { | |
| # Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1. | |
| # NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6). | |
| # Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470 | |
| docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}' |
| # Ask for the user password | |
| # Script only works if sudo caches the password for a few minutes | |
| sudo true | |
| # Install kernel extra's to enable docker aufs support | |
| # sudo apt-get -y install linux-image-extra-$(uname -r) | |
| # Add Docker PPA and install latest version | |
| # sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
| # sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
| #!/usr/bin/env bash | |
| # Installs NixOS on a Hetzner Cloud CX51 server, wiping the server. | |
| # | |
| # This is for a specific server configuration; adjust where needed. | |
| # | |
| # Prerequisites: | |
| # * Update the script to adjust SSH pubkeys, hostname, NixOS version etc. | |
| # | |
| # Usage: |
| # Specify the shell | |
| SHELL := bash | |
| # Site URL | |
| OLD_URL = https://domain.test | |
| NEW_URL = https://www.domain.com | |
| # Commands to execute | |
| execute: |
| #!/bin/bash | |
| LOCATION=${HCLOUD_LOCATION:-nbg1-dc3} | |
| if [ -z "$HCLOUD_TOKEN" ]; then | |
| echo "You need to set HCLOUD_TOKEN to an Hetzner API token!"; | |
| exit 1 | |
| fi | |
| if [ -z "$SSH_KEY" ]; then |