Skip to content

Instantly share code, notes, and snippets.

View jakehamilton's full-sized avatar

Jake Hamilton jakehamilton

View GitHub Profile
import web.console
import press.html $ html div button span
import press.hooks $ use-state use-effect
fn app [] $ let
#vector
counter $ use-state 0
use-effect
fn []
; This file is managed by the `sample` command line program and contains project information
; such as dependencies.
(project
(base ".")
(main "sample.lisp")
(dependencies
((dependency
(type :git)
(source "git@...")
(hash "sha256-..."))
@jakehamilton
jakehamilton / sample.redacted
Last active January 24, 2025 17:29
sample.redacted
let Types := import ./types.redacted;
\{ pkgs :: Packages; name :: Types.Name = "Default" } ->
let add := \a :: Number -> \b :: Number ->
let result := a + b;
result;
let greeting := "Hello, ${name}";
@jakehamilton
jakehamilton / guide.md
Created February 22, 2024 13:14
NixOS Install Workaround

So you're having some trouble with your NixOS install. Well, here are the steps that finally worked for me:

  1. Limit system closure

It's not clear if some packages were actually broken, my system was incapable of reproducing them, or if the amount of packages was the problem. However, all of these can be worked around by removing any unnecessary programs, services, and configuration from the system. I did this in my configuration by disabling all of the programs and features not required for a barebones system to boot with my user account:

@jakehamilton
jakehamilton / evolve_sync.js
Created December 29, 2023 05:29 — forked from Daxtorim/evolve_sync.js
Automatically synchronize EvolveIdle saves across devices
// ==UserScript==
// @name EvolveIdleSaveManager
// @version 0.1
// @description Automatically synchronize EvolveIdle saves across devices
// @author Daxtorim
// @match https://pmotschmann.github.io/Evolve/
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.io
// @require https://code.jquery.com/jquery-3.7.0.min.js
// @grant unsafeWindow
// ==/UserScript==
@jakehamilton
jakehamilton / Steam Tinker Launch.md
Last active February 7, 2026 16:58
Steam Tinker Launch NixOS Notes
  • #define [[Steam Tinker Launch]] is a compatibility tool that takes over game start. This allows for easy control of things like mod manager, custom [[Proton]] versions, etc.
  • Install

    • Grab the package from NixPkgs.

      		  { pkgs, ... }:
      		  {
      		    environment.systemPackages = with pkgs; [
      		      steamtinkerlaunch

];

@jakehamilton
jakehamilton / journalctl.log
Created September 26, 2022 03:02
The journal entries from trying to run a virtual machine using virt-manager on my NixOS system.
Sep 25 19:58:04 bismuth dnsmasq[45738]: started, version 2.86 cachesize 150
Sep 25 19:58:04 bismuth dnsmasq[45738]: compile time options: IPv6 GNU-getopt DBus no-UBus no-i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth cryptohash DNSSEC loop-detect inotify dumpfile
Sep 25 19:58:04 bismuth dnsmasq-dhcp[45738]: DHCP, IP range 192.168.122.2 -- 192.168.122.254, lease time 1h
Sep 25 19:58:04 bismuth dnsmasq-dhcp[45738]: DHCP, sockets bound exclusively to interface virbr0
Sep 25 19:58:04 bismuth dnsmasq[45738]: reading /etc/resolv.conf
Sep 25 19:58:04 bismuth dnsmasq[45738]: using nameserver 100.100.100.100#53
Sep 25 19:58:04 bismuth dnsmasq[45738]: read /etc/hosts - 5 addresses
Sep 25 19:58:04 bismuth dnsmasq[45738]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
Sep 25 19:58:04 bismuth dnsmasq-dhcp[45738]: read /var/lib/libvirt/dnsmasq/default.hostsfile
Sep 25 19:58:04 bismuth tailscaled[7007]: post-rebind ping of DERP region 17 okay
@jakehamilton
jakehamilton / Lowlight.tsx
Last active July 21, 2022 23:22
Lowlight TipTap DOM Highlighting
import { lowlight } from "lowlight/lib/common";
import type { Span, Text } from "lowlight/lib/core";
import type { ReactElement } from "react";
import { useEffect, useRef, cloneElement } from "react";
const renderElement = (node: Span | Text) => {
if (node.type === "text") {
return document.createTextNode(node.value);
} else {
const el = document.createElement(node.tagName);
@jakehamilton
jakehamilton / Dynamic.tsx
Created October 26, 2021 00:18
Preact Dynamic Components
import { FunctionComponent, VNode } from "preact";
import { JSXInternal } from "preact/src/jsx";
type Error<Message extends string> = { readonly __message: Message };
type At<Arr extends Array<unknown>, N extends number> = Arr extends Record<
N,
infer T
>
? T
@jakehamilton
jakehamilton / install.sh
Last active October 20, 2021 20:37
Little UI Early Preview - Installation and Setup
# Clone the repo (only the feat/ui branch)
git clone git@github.com:jakehamilton/littlethings.git -b feat/ui
# Enter the cloned repo
cd littlethings
# Install dependencies for managing the repo
npm install
# Install and link local modules (via Titan)