mv config.yml /home/daniel/.config/xremap/config.yml
mv service.sh /home/daniel/.config/xremap/service.sh
sudo mv xremap.service /etc/systemd/system/xremap.service
This file contains 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
use_flake './flake.nix' |
This file contains 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
v() { | |
# runs nvim in a nix-shell with nodejs_20 | |
# sets NPM_GLOBAL_DIR so no sudo is needed to install global npm packages | |
NODE_STR="nodejs_20" | |
NPM_GLOBAL_DIR="/home/$USER/.npm-global/$NODE_STR" | |
mkdir -p $NPM_GLOBAL_DIR | |
echo "running lvim $1" | |
echo "within nix-shell -p $NODE_STR" | |
PATH=$NPM_GLOBAL_DIR/bin:$PATH NPM_CONFIG_PREFIX=$NPM_GLOBAL_DIR nix-shell -p $NODE_STR --run "lvim $1" | |
} |
This file contains 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
use nix |
This file contains 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
// Svelte flash animation for new elements | |
// source: https://learn.svelte.dev/tutorial/svelte-options | |
export default function flash(element) { | |
requestAnimationFrame(() => { | |
element.style.transition = 'none'; | |
element.style.color = 'rgba(255,62,0,1)'; | |
element.style.backgroundColor = 'rgba(255,62,0,0.2)'; | |
setTimeout(() => { |
This file contains 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
<script lang="ts"> | |
import { derived, readable, writable } from 'svelte/store' | |
type States = 'view' | 'edit' | |
const state = writable<States>('view') | |
const _substate = derived(state, ($state) => { | |
if ($state === 'edit') return writable<{ item?: number }>({}) | |
return readable(null) | |
}) |
extractRecordOptions(anyZodSchema)
generates automatically a correct object { fields: "...", expand: "..." }
which can be passed to the pocketbase sdk.
We can use the same schema to parse/validate and strongly type the response.
This file contains 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
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
NewerOlder