- Create a Droplet on e.g. DigitalOcean.
- Make sure it has at least 1 vCPU and 1 GB of memory.
- Mine has: 1 vCPU, 1 GB, 35 GB NVMe SSD, Premium Intel CPU, Ubuntu 24.04 LTS for $8/month on Digital Ocean
- Choose SSH KEY AUTHENTICATION and create a new SSH key.
- Remember the server's IPv4 address.
- Sign up for a Container Registry e.g. on Digital Ocean for $5/mo (the 500MB free plan won't cut it)
- Remember your username on the registry
- Create an API Token at https://cloud.digitalocean.com/account/api/tokens for pushing images to the registry.
- It needs to have these scopes:
registry (4): delete, update, read, create
- It needs to have these scopes:
- Install Kamal with
gem install kamal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---@param types string[] Will return the first node that matches one of these types | |
---@param node TSNode|nil | |
---@return TSNode|nil | |
local function find_node_ancestor(types, node) | |
if not node then | |
return nil | |
end | |
if vim.tbl_contains(types, node:type()) then | |
return node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# - pip install marko (in a venv or system wide if you want) | |
# - python logseq_to_org.py <logseq's pages directory> <output folder> | |
import datetime as dt | |
import re | |
import sys | |
import uuid | |
from contextlib import contextmanager | |
from dataclasses import dataclass, field |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Define the events that should trigger the startWorkDay function | |
local startWorkDayEvents = { | |
hs.caffeinate.watcher.systemDidWake, | |
hs.caffeinate.watcher.screensDidUnlock, | |
hs.caffeinate.watcher.screensaverDidStop | |
} | |
-- Function to check if the event should trigger the startWorkDay function | |
local function shouldTriggerStartWorkDay(eventType) | |
for _, startWorkDayEvent in ipairs(startWorkDayEvents) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wrap any function in | |
javascript: (function () { | |
// javascript goes here | |
})(); | |
minify and then create a bookmark with the URL as the minified JavaScript | |
// grayscale all images without an alt tag | |
const css = document.createElement("style"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# zn - as zettell | |
# new export variables EDITOR for your editor and | |
#+ NOTES for your notes folder. | |
main () { | |
note_id=$(date +'%Y%m%d%H%M%S') | |
$EDITOR $NOTES/"$note_id".md | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places. | |
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of | |
###. things to watch out for: | |
### - Check out the `nix-darwin` instructions, as they have changed. | |
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026 | |
### | |
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs). | |
# So here's a minimal Gist which worked for me as an install on a new M1 Pro. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/env zsh | |
# Install zcomet, if necessary | |
if [[ ! -f ${ZDOTDIR:-${HOME}}/.zcomet/bin/zcomet.zsh ]]; then | |
command git clone https://github.com/agkozak/zcomet.git ${ZDOTDIR:-${HOME}}/.zcomet/bin | |
fi | |
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### phx live view 0.16 with leex | |
def render(assigns) do | |
~L""" | |
<button class="<%= if @foo && @bar && @baz do %>text-blue-600<% else %>text-red-600<% end %>">hello</button> | |
""" | |
end | |
##### phx live view 0.16 with heex -inline edition |
NewerOlder